[zeromq-dev] New Python bindings

Brian Granger ellisonbg at gmail.com
Sat Feb 13 00:35:40 CET 2010

Hello all,

Over the last day I have redone the Python bindings from scratch.  The
overall design is the same, but I have used Cython, which will make
the bindings easier to develop/maintain and more flexible in the long
run.  Here is my github repo for this:


Some highlights of what I have done so far:

* Cython (http://www.cython.org) based.  Cython is not a requirement
for using this, only
for developers.
* Improved performance.  For small msg sizes, the performance is the
same as the previous Python bindings, but for larger message sizes,
the latency and throughput
benchmarks are better.  The main improvement is that on sends I am not
doing a memcpy
to copy the Python string to the msg struct.  The msg struct simply
uses the same buffer
that the Python str object is using.
* Better error handling.
* A build system (setup.py) that is standalone and a bit more configurable.
* New send_json/revc_json and send_pyobj/recv_pyobj methods of Socket that
allow you to send Python objects as messages using Python's pickle
serialization or json.

The only part of the API that I have not wrapped is zmq_poll.  This is
next on my list.  But first, I want to understand the design of
zmq_poll a bit better.  I have started a thread to discuss those

I have licensed this code as LGLP and am fine with it being pulled
into the main zeromq repo if that is wanted.



Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com

More information about the zeromq-dev mailing list