[zeromq-dev] ØMQ VSM data alignment
Ben Kloosterman
bklooste at gmail.com
Sat Aug 7 14:26:08 CEST 2010
Is that with optimizations on ? Vc++ and Intel do 4 byte packing by default
but it can be adjusted. When I set it to pack 1 performance dropped a bit
, I would be surprised pack 1 is default on gcc *maybe for debug or -Os).
Ensuring sizeof() was 32 also gave a boost ( prob due to fitting more in a
cache line )
Ben
>-----Original Message-----
>From: Matt Weinstein [mailto:matt_weinstein at yahoo.com]
>Sent: Saturday, August 07, 2010 7:40 PM
>To: bklooste at gmail.com; 0MQ development list
>Subject: Re: [zeromq-dev] ØMQ VSM data alignment
>
>That's what gcc on CENTOS5/64 reported ...
>
>I like Martin's solution to put vsm_data at the head of the structure.
>
>In that case you get an added "feature": if you overrun the vsm_data
>you'll trash your own structure, so you'll know whose fault it is. :-)
>
>
>
>On Aug 6, 2010, at 11:13 PM, Ben Kloosterman wrote:
>
>>>> 0x00 void *content;
>>>> 0x08 unsigned char flags;
>>>> 0x09 unsigned char vsm_size;
>>>> 0x0a unsigned char vsm_data [ZMQ_MAX_VSM_SIZE];
>> This is incorrect in most cases its
>>
>> 0x00 void *content;
>> 0x08 unsigned char flags;
>> 0x0a unsigned char vsm_size;
>> 0x0d unsigned char vsm_data [ZMQ_MAX_VSM_SIZE];
More information about the zeromq-dev
mailing list