[zeromq-dev] pub matcher again

Martin Sustrik sustrik at 250bpm.com
Tue Aug 24 11:54:53 CEST 2010


Matt,

>> However, it's not a good idea to map the pipes using names. Matching
>> strings is slow. You should store either pointer of index that would
>> allow you to access the pipe in O(1) time.
>>
> Wondering - Isn't memcmp unrolled on Linux? You could just define
> uuid_t as a fixed array (or vector<unsigned char>) and define
> operator==() using memcmp?
> (Still two words and a smidgeon but...)

It's about finding the name in the list of names rather than comparing 
two names. Using a vector or a map would result in O(n) or O(log n) 
comparisons respectively.

Martin



More information about the zeromq-dev mailing list