<div dir="ltr">A few points:<br><div class="gmail_quote"><div dir="ltr"><div><br></div><div>- You have nodelay turned on for the Erlang code but not the C++ code; this will slow things down.</div><div><br></div><div>- You specify many other tuning options.  I suggest removing them all unless you are absolutely certain a default is causing you problems.</div>

<div><br></div><div>- On the receive side, {active, once} might be faster.  For most uses it is the best way to do socket receives in Erlang.</div><div><br></div><div>Cheers,</div><div>Dan.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Jun 18, 2013 at 6:45 AM, Peter <span dir="ltr"><<a href="mailto:syupei@gmail.com" target="_blank">syupei@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
i test for the socket rec/sed speed,<br><br> i used  c++、Erlang and golang,  and the result like this:<br><br><img alt=""><br><br><br>so, i want know,  why always  slow  when erlang as a rec-server.  is use wrong?<br><br>

my source code see attachment,  and my test case like this:<br><br>the erlang server:<br><span style="color:rgb(255,0,0)">erl +K true </span><br><span style="color:rgb(0,0,255)">server:start(8080, 200)</span><br><br>the erlang client:<br>

<span style="color:rgb(255,0,0)">erl +K true</span><br><span style="color:rgb(0,0,255)">client:start(192.168.0.1, 8080, 200, 1000*10000)</span><br><br>the cpp server:<br><span style="color:rgb(255,0,0)">./server 192.168.0.1 8080 200</span><br>

<br>the cpp client:<br><span style="color:rgb(255,0,0)">./client 192.168.0.1 8080  10000000 200</span><br><br><br><br><br><div><div dir="ltr" style="zoom:1"><span lang="en"><span></span><span></span><span><br></span></span></div>

</div><div></div><div></div><br></div></div>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>
</div><br></div>