3 ms·
We're a bit faster than libevent in terms of dispatch throughput; some benchmarks in this commit message: https://github.com/facebook/libphenom/commit/41b6106f0
by wezfurlong 13y ago
We're a bit faster than libevent in terms of dispatch throughput; some benchmarks in this commit message:
https://github.com/facebook/libphenom/commit/41b6106f04fe62cb1d86c9682ded55ab3be980a9 https://github.com/facebook/libphenom/commit/41b6106f04fe62c...
The `tests/bench/iopipes.t` "test" allows you to play with some concurrency parameters to try this for yourself on your hardware.
We haven't compared against libev.
We've added some more APIs (buffers and sockets) since those benchmarks were done and we don't have numbers to share around those yet.
One key difference between libevent, libev and libuv is that libphenom is inherently multithreaded in its IO dispatcher and timeout implementation.
If you're dispatching purely CPU bound jobs, we get very close to linear scaling with the number of cores:
https://github.com/facebook/libphenom/commit/c2753c2154a0cffc0bd70e8f28dd0ea884aab4fd https://github.com/facebook/libphenom/commit/c2753c2154a0cff...
- mrb 13y agoWhat do you mean by "inherently multithreaded"? I have written a network application handling 100-500k TCP concurrent connections using libev. It was multithreaded to distribute the number of connections evenly per thread (typically from 10k to 100k connections per thread). This is a model that is perfectly supported by libev. And I observed a nice linear scaling of the network throughput with the number of cores since my jobs were also purely CPU-bound. Depending on how CPU intensive my jobs were exactly, my libev code needed anywhere from 2 to 10 threads to saturate a GbE link.
- wezfurlong 13y agoThe principal difference between the libphenom event dispatcher and the other event libraries is that libphenom can wakeup and dispatch IO events to any of the IO scheduling threads (no thread affinity). Contrast with the libevent approach of using an application specific scheme to assign descriptors to an event base associated with a thread (strong thread affinity). This makes more of a difference if you have chatty protocols and/or long lived sessions and no way to rebalance your fd -> event_base mapping.