On Mon, Nov 30, 2009 at 02:49:09AM -0500, Donghua Xu wrote: > Thanks Nick. How do I enable the "common timeout" logic? Or is it > enabled by default in 2.0.3-alphra?
Check out the documentation for event_base_init_common_timeout() in include/event2/event.h in Libevent 2.0.3-alpha. Basically, if you have many many events that all use timeouts of the same duration, you can use the new function to make sure that they get put in a queue rather than the minheap, so that you get O(1) performance for adding and running each one rather than O(lg n). If your million timeout durations are not clustered like this, this patch won't help. The original patch at https://sourceforge.net/mailarchive/message.php?msg_name=E1N7Xqx-0001rz-7M%403kljzd1.ch3.sourceforge.com might also be good to look at. yrs, -- Nick *********************************************************************** To unsubscribe, send an e-mail to [email protected] with unsubscribe libevent-users in the body.
