This is a benchmark of libmowgli verses the typically-used libevent eventloop implementation. To benchmark, we ported
bench.c from Niels Provos'
libevent-1.4 distribution to libmowgli. That ported
can be found in the libmowgli-2 GIT repository.
libevent is a high-performance event loop that supports two event types (I/O+timeout or timers) and a number of backends, such as epoll or kqueue.
It uses red-black trees for timers, binary heaps and doubly-linked lists for event structures.
libmowgli is the base library for the Atheme development platform. It contains various data structures, support for hooks, timers, etc. As of version 2, it contains an eventloop, which is the subject of this benchmark.
It uses an array to manage timers, ordered by earliest deadline first. Management of other event types are handled directly by the most appropriate backend for minimal overhead.
This dataset is a manipulated version of a larger dataset expanded to show performance between 100-2000 active file descriptors, and 100 active events per iteration cycle. This would be a typical workload for an IRC daemon.
As seen here, performance is marginally better in the mowgli.eventloop implementation over libevent, however both are basically on par with each other.