[zeromq-dev] Very Small Messages/Manual

Ben Kloosterman bklooste at gmail.com
Sun Jul 25 03:06:52 CEST 2010

While allowing 64 byte messages  would be faster for messages from size
30-64 am I right in saying it would also incur a penalty for all messages of
size greater than 64 bytes ?  Since the 64 byte data would be allocated and
at the least would incur a memory penalty.  Also I suspect the transport
affects the results eg for Core2 up to 128 bytes copying was faster for


 >-----Original Message-----
 >From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-
 >bounces at lists.zeromq.org] On Behalf Of Matt Weinstein
 >Sent: Sunday, July 25, 2010 1:36 AM
 >To: 0MQ development list
 >Subject: Re: [zeromq-dev] Very Small Messages/Manual
 >Perhaps there should be a section entitled e.g. " Optimizing ZMQ "
 >somewhere in the online documentation...
 >For example, you *could* tweak the VSM size (according to zmq.h) for
 >certain applications and architectures --
 >/*  Maximal size of "Very Small Message". VSMs are passed by
 >value            */
 >/*  to avoid excessive memory allocation/
 >deallocation.                        */
 >/*  If VMSs larger than 255 bytes are required, type of
 >'vsm_size'            */
 >/*  field in zmq_msg_t structure should be modified
 >accordingly.              */
 >#define ZMQ_MAX_VSM_SIZE 30
 >On Jul 24, 2010, at 10:57 AM, Martin Sustrik wrote:
 >> Oliver Smith wrote:
 >>> Martin Sustrik wrote:
 >>>> Messages below 30 bytes of
 >>>> length are called VSMs (very small messages) in 0MQ and are passed
 >>>> *without* any extra memory allocations.
 >>> Actually, this is a fairly important/useful piece of information.
 >>> Can I
 >>> suggest that it be added to the main zmq.html of the manual under the
 >>> Messages heading?
 >> Hm. It's kind of an implementation detail. Our tests have shown that
 >> for
 >> messages below 30 bytes copying them is less expensive than
 >> allocating/deallocating a chunk for the data. As everything stays
 >> opaque
 >> for the users, I am not sure why they would be interested in that kind
 >> of detail.
 >> Martin
 >> _______________________________________________
 >> zeromq-dev mailing list
 >> zeromq-dev at lists.zeromq.org
 >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
 >zeromq-dev mailing list
 >zeromq-dev at lists.zeromq.org

More information about the zeromq-dev mailing list