<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">On my Mac (2.5 GHZ Intel Core i7), using all cores, I get the same:</div><div class=""><br class=""></div><div class="">Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]<br class=""><br class="">Eshell V5.10.4  (abort with ^G)<br class="">1> Data = list_to_binary(lists:duplicate(256,$x)).<br class=""><<"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"...>><br class="">2> timer:tc(fun() -> lists:foreach(fun(_) -> QR = qrcode:encode(Data), qrcode_demo:simple_png_encode(QR) end, lists:seq(1,5)) end).<br class="">{1491915,ok}</div><div class=""><br class=""></div><div class="">If, OTOH, I do this:</div><div class=""><br class=""></div><div class="">3> PEval = fun(F,N) -> Ps = [spawn_monitor(fun() -> exit({ok,F()}) end) || _ <- lists:seq(1,N)], [receive {'DOWN',Ref,_,_,{ok,R}} -> R after 10000 -> error(timeout) end || {_,Ref} <- Ps] end.<br class="">#Fun<erl_eval.12.80484245><br class="">4> timer:tc(fun() -> PEval(fun() -> QR = qrcode:encode(Data), qrcode_demo:simple_png_encode(QR) end, 5) end).<br class="">{357630, …}<br class=""><br class=""></div><div class="">Then, the performance seems to be really there. Is there something I’m missing, that they have to be generated sequentially?</div><div class=""><br class=""></div><div class="">BR,</div><div class="">Ulf</div><br class=""><div><blockquote type="cite" class=""><div class="">On 01 Oct 2015, at 00:28, Tony Rogvall <<a href="mailto:tony@rogvall.se" class="">tony@rogvall.se</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; font-family: Monaco; background-color: rgb(251, 248, 255);" class="">Data = list_to_binary(lists:duplicate(256,$x)).</div><div style="margin: 0px; font-family: Monaco; background-color: rgb(251, 248, 255);" class=""><div style="margin: 0px;" class="">timer:tc(fun() -> lists:foreach(fun(_) -> QR = qrcode:encode(Data), qrcode_demo:simple_png_encode(QR) end, lists:seq(1,5)) end).</div><div style="margin: 0px;" class="">{1401102,ok}</div><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">The performance is nearly there ( running on my mac using only one core )</div><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">/Tony</div><div style="margin: 0px;" class=""><br class=""></div></div><div class=""><blockquote type="cite" class=""><div class="">On 1 okt 2015, at 00:13, Theepan <<a href="mailto:vasdeveloper@gmail.com" class="">vasdeveloper@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Team,<div class=""><br class=""></div><div class="">I am in need of a QR code generator library for Erlang, to generate QR code PNG images of 256 alpha numeric characters.</div><div class=""><br class=""></div><div class="">When I searched the Internet, I found one on GitHub. Have anyone of you used it? Do you have any recommendations?</div><div class=""><br class=""></div><div class="">The performance I need is 5 QR code images generation per second.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Theepan</div></div>
_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class=""><a href="http://erlang.org/mailman/listinfo/erlang-questions" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class=""></div></blockquote></div><br class=""></div>_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">http://erlang.org/mailman/listinfo/erlang-questions<br class=""></div></blockquote></div><br class=""><div apple-content-edited="true" class="">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div class=""><div class="">Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.</div><div class=""><a href="http://feuerlabs.com" class="">http://feuerlabs.com</a></div></div><div class=""><br class=""></div></span><br class="Apple-interchange-newline">

</div>
<br class=""></body></html>