[erlang-questions] why my test case of socket are always slower much than c++

Daniel Goertzen <>
Tue Jun 18 17:41:28 CEST 2013


A few points:

- You have nodelay turned on for the Erlang code but not the C++ code; this
will slow things down.

- You specify many other tuning options.  I suggest removing them all
unless you are absolutely certain a default is causing you problems.

- On the receive side, {active, once} might be faster.  For most uses it is
the best way to do socket receives in Erlang.

Cheers,
Dan.


On Tue, Jun 18, 2013 at 6:45 AM, Peter <> wrote:

> i test for the socket rec/sed speed,
>
>  i used  c++、Erlang and golang,  and the result like this:
>
>
>
>
> so, i want know,  why always  slow  when erlang as a rec-server.  is use
> wrong?
>
> my source code see attachment,  and my test case like this:
>
> the erlang server:
> erl +K true
> server:start(8080, 200)
>
> the erlang client:
> erl +K true
> client:start(192.168.0.1, 8080, 200, 1000*10000)
>
> the cpp server:
> ./server 192.168.0.1 8080 200
>
> the cpp client:
> ./client 192.168.0.1 8080  10000000 200
>
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130618/c1f084d4/attachment.html>


More information about the erlang-questions mailing list