[zeromq-dev] Newbie questions regarding performance

Aaron Koolen-Bourke aaronkoolen at gmail.com
Fri Mar 18 11:49:22 CET 2016

Hi all. I'm currently tasked with building a small test application to test
0MQ's performance for a possible replacement of our legacy messaging.

The performance tests that come with libzmq obviously show great
performance (8us latency on my box) but when I build a slightly different
test of my own I'm getting comparatively terrible performance (2000us). Now
I am sure this is my fault but I'm banging my head against a wall now and
need some help.

First, my setup - Windows platform, release mode builds using VS2015. Using
CZMQ and 0MQ version 4.1.4.

I built what I thought was a simple pipeline as suggested in the guide.

PUSH->PULL->PULL (calculates entire time of message processing)

The steps I do.

Create producer zactor with a ZMQ_PUSH socket for "tasks". Then send 10000,
4 byte messages in a tight loop using zsock_bsend(socket, "4", count);

Create another actor that is a ZMQ_PULL for receiving messages to indicate
the task as been completely processed by a worker. I did this so I could
measure the entire round trip.

Create worker actor with a ZMQ_PULL to the producer. In tight loop I call
zsock_brecv to receive those 4 bytes. When I do, I calculate the time since
it was sent and post that as a message to the reply actor. That actor
stores the value in a pre-allocated vector.

So, to a newbie like myself it seems that I'm doing 2 sends and 2 receives,
so I would expect something in the ballpark of the lib tests.

Hope that was clear.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160318/b7b0f969/attachment.htm>

More information about the zeromq-dev mailing list