On Nov 15, 2011, at 2:36 PM, MinRK wrote:

> e.g.
> 
> struct sequence_id {
>  uint64 number;
>  uchar  uuid[16];
> };
> 
> Is this all right? Or is there a better way to accomplish this framing?
> 
> cr
> 
> I have a general question related to this - what is the relative cost in 
> zeromq of these being separate very-small messages versus one packed message? 
> Has someone done perf tests for this kind of thing?

I haven't tested it, but I assume that reading a multipart message versus a 
single-part message is more time consuming due to 2 factors.

1. The I/O thread needs to make sure all parts are accounted for before atomic 
delivery.

2. The #recv has to examine the message frame for the RCVMORE bit.

It's minor work, but as we all know, the fastest code is "no code."

On a related topic, I packed these two details together because they are 
logically related. The unique sequence_id is a combination of sequence_number 
and uuid.

cr


_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to