
On 18 February 2011 01:05, Johan Tibell
On Thu, Feb 17, 2011 at 5:01 PM, Bas van Dijk
wrote: willTimeout/old 24.34945 us 1.0 x willTimeout/new 26.91964 us 0.9 x (large std dev: 5 us) willTimeout/event 12.94273 us 1.9 x :-)
wontTimeout/old 16.25766 us 1.0 x wontTimeout/new 637.8685 ns 25.5 x :-) wontTimeout/event 1.565311 us 10.4 x :-)
I find this very surprising. Both new and event eventually ends up using the event manager in the end. One via threadDelay (which calls registerTimeout) and one directly via registerTimeout. The difference should be that "new" also spawns a thread.
I guess the new timeout exploits parallelism because it forks a thread do to the work with the event manager. I think that this thread is then killed before it even begins dealing (through threadDelay) with the event manager. Bas