[zeromq-dev] 2ms roundtrip with python bindings

Charles Remes lists at chuckremes.com
Thu Mar 27 19:18:31 CET 2014


On Mar 27, 2014, at 12:36 PM, Mark <markreed99 at gmail.com> wrote:

> Mark <markreed99 <at> gmail.com> writes:
> 
>> 
>> I modified the hello world client to time a single send and recv across 
>> my network and get 1.6ms:
> 
> Note that I removed the sleep from hwserver.py. 
> 
> import time
> import zmq
> 
> context = zmq.Context()
> socket = context.socket(zmq.REP)
> socket.bind("tcp://*:port")
> 
> while True:
>    message = socket.recv()
>    socket.send(b”World")

No, the problem is that you are comparing apples and oranges. 

The perf latency test does 10,000 roundtrips and averages the number. Your first few messages are probably going to be slower due to TCP congestion algos and whatnot.

Your second test sends just ONE message. You never give the TCP stream any time to warm up.

You could rewrite that second test in pure C and get the same result.

Nothing wrong with the python bindings.

cr




More information about the zeromq-dev mailing list