[zeromq-dev] tcp vs zeromq

Bennie Kloosteman bklooste at gmail.com
Sat Jul 13 03:32:36 CEST 2013


If you run it without a network stack zeromq can be very fast  so its not
so much the protocol. You can see this in the tests but note in those cases
zeromq is using C++.  For lots of small messages < 100 bytes zeroMq does
need a lot more cpu than tcp but that is not a common scenario.

There is also a cost for Java... Both C# and Java are GC languages so need
to copy  packets to and from  zeromq , the Java tcp stack is likely to
 have optmizations to reduce this significantly ( while the zeromq java and
C# wrappers are minimal last time i looked at them) . If zeromq was in the
kernel this could be reduced but right now it has a cost eg Kernel copy to
C++ user space copied to Java  GC space.     If i was using zeromq  and
found after building the system i needed faster  speeds  I would use async
and than i would rewrite that part of the system in C++   and pass a
"fixed" pointer to the packet when needed rather than copying everything
into the GC space and then copying it into the logic domain.


On Sat, Jul 13, 2013 at 1:51 AM, ashwini ramamurthy <ashwini.ram21 at gmail.com
> wrote:

> Hi All,
>
> To compare the performance of zeromq and tcp  I did the following
> experiment
>
>
>
> *Experimental setup for zeromq *
>
>    -  android client(Motorola razr) which runs jeromq.
>    -  java server(PC running Linux) which runs java binding of zeromq
>    -  Using the REQUEST-REPLY messaging pattern
>    - Sending 100/1000 messages to the server and 100/1000 messages to
>    client (synchronous)
>    - The client sends a hello message and waits for a reply from the
>    server to send another message(ping-pong)
>    - The server waits for a message and replies with a hello for every
>    message sent
>    - Both the devices were connected through wifi
>    - *On an avg:For 100 messages the time taken was 937 msec*
>    - *On an avg:For 1000 messages the time taken was 8270 msec*
>
> *Experimental setup for TCP*
>
>    - android client (Motorola razr)
>    - java server (PC running Linux)
>    - Using a REQ-REP pattern(ping-pong)
>    - Sending 100/1000 messages to the server and 100/1000 back to
>    client(synchronous)
>    - Same as above, client sends a hello message to server and waits to
>    receive a world message before sending the next message.
>    - Both the devices were connected through wifi
>    - *On an avg:For 100 messages the time taken was 504 msec*
>    - *On an avg:For 1000 messages the time taken was 5240 msec*
>
> Is this excepted? or am i missing something or doing something wrong?
>
>
>
> Thanks,
>
> Ashwini
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130713/3951d592/attachment.htm>


More information about the zeromq-dev mailing list