[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Strange timeout scheduling in 1.4



On Thu, Jul 28, 2011 at 11:32 AM, Leonid Evdokimov <leon@xxxxxxxxxxxx> wrote:
> Also, FYI, I tried to use event_base_init_common_timeout with trivial
> timeout callback and got following numbers:
>
> 18% of single CPU core usage with 65536 250ms persistent timeouts
> 7% of single CPU core usage with 65536 250ms persistent common-timeouts
>
> So common timeouts are really nice and, moreover, trivial to use.

Great!  That's pretty much the intended use-case of common timeouts:
taking advantage of the fact that if you know that a large number of
timeouts are all the same value, you can have a priority queue run in
O(n) time rather than O(n lg n).

I'm glad they turned out to be useful for somebody. (Besides the
initial guy who reported the issue, who just wanted us to switch from
a heap to a queue because it was faster for _his_ load.  Yeah, not
gonna do that one. ;) )

yrs,
-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.