Code review comment for lp:~dirk.zimoch/epics-base/named-soft-events

Revision history for this message
Ben Franksen (bfrk) wrote :

On Mittwoch, 27. Oktober 2010, Dirk Zimoch wrote:
> I tested long event names like "Event with a very long name number
> 123" (up to 38 chars, the first 35 of them the same for all 255
> events) named-soft-events
> 3.145 seconds
> named-soft-events2
> 2.381 seconds
>
> More or less the same as with short event names. (Numbers vary a bit
> from turn to turn)

Interesting. I'd have expected the ratio between the two versions to
increase for longer strings. I did some research and found that gcc
heavily optimises strcmp, resulting (on certain architectures) in
machine code that uses 16-byte instructions, see

http://stackoverflow.com/questions/1128096/c-string-comparison-in-one-clock-cycle

You learn a bit more every day...

Cheers
Ben
--
"Never confuse what is natural with what is habitual."
                                   -- attributed to Mahatma Gandhi

« Back to merge proposal