You are not logged in.
Both provide the same basic functionality. Libevent is being worked on more at the moment (and is also in [core], iirc), while parts of libev have stagnated a bit (though it is a much smaller library).
The thing that bothers me is that the whole premise behind libev is that it's faster than libevent.. this claim doesn't really hold up under scrutiny. I built the latest libevent (2.0.3-alpha) and libev (3.9) sources and ran libev's bench.c* on it. On my arch64 laptop, libevent consistently wins handily.
* http://libev.schmorp.de/bench.c, was pulled and modified from the libevent test suite. The "ts" timeval struct seems to be the counter for libevent's routines, while "ta" is for libev. Libevent is finishing 100 to 150 usecs quicker than libev on my computer. I compiled with: gcc -O2 bench.c libev-3.9/ev.o libevent-2.0.3-alpha/*.o -lm -lpthread -lssl -lrt -o bench_test.
Please let me know if there's something wrong with the way I compared the two libraries. If you have any experience with either, I'd like to hear what you think of them.
div curl F = 0
Offline
I don't have experience with either library, but just looking at what you said, libevent seems to be the winner.
Last edited by tomd123 (2010-02-10 23:40:44)
Offline
The results are bogus - bench.c has to be linked against the library you want to test, and is not ABI-compatible with the default libev, so you have to compile in ev.c and event.c as well.
All you did was benchmark libevent against itself, and if you got different results, this is just variation (proof: it would segfault if it called the functions in ev.o).
If you compile two binaries you can run three benchmarks - libevent, libev+event API and libev+native API.
Then you will get the expected result, actually worse with libevent-2.0 when compiled with pthread-support, as it locks the loop on every single access, something not required by libev.
Offline