On 11 June 2010 13:16, Martin Sustrik <[email protected]> wrote: > Let me explain the problem: To do exact timouts, zmq_poll would have to > measure exact time (gettimeofday) at the beginning of the function. If > it doesn't know the time it was invoked, it cannot terminate at right time. > > This time measurement is the impact I am speaking of. Although it may > seem negligible, in a tight loop it can decrease overall throughput (I'm > guessing here) by ~30%. > > One way to solve the problem would be to use some fast mechanism (such > as rdtsc on x86/64) to find out whether noticeable time has elapsed > since last call to zmq_poll (say at least 1ms), call gettimeofday only > if it did, and use the previous time measurement if it didn't. > > Of course, this would leave non-x86 platforms with the full performance > impact.
With Nehalem you should be using gettimeofday() as it's now using rdtscp which apparently solves world hunger according the LKML. On SPARC, RS6000, PA-RISC gettimeofday() is already light so the only issue would appear to be older x86 platforms and possibly the embedded range which performance is kind of moot anyway. -- Steve-o
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
