benchmarking libmowgli against libevent

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 bench.c can be found in the libmowgli-2 GIT repository.

libevent overview

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 overview

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.

First dataset: IRCd-sized workloads

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.

Time spent in event handling code Time spent per each iteration

As seen here, performance is marginally better in the mowgli.eventloop implementation over libevent, however both are basically on par with each other.

Second dataset: 100 - 102400 active file descriptors, 100 active clients

Time spent in event handling code Time spent per each iteration

Third dataset: 1000 - 128000 active file descriptors, 1000 active clients

Time spent in event handling code Time spent per each iteration