eventcore vs boost.asio performance?
Sönke Ludwig
sludwig at outerproduct.org
Mon Feb 20 08:26:23 UTC 2023
Am 19.02.2023 um 20:53 schrieb zoujiaqing:
> eventcore is a very good and stable network library based on the
> Proactor model.
> These high-performing C++ frameworks all use asio.
> What can we achieve if we use eventcore as network io?
>
> * https://github.com/vibe-d/eventcore
> *
> https://www.techempower.com/benchmarks/#section=data-r21&hw=cl&test=plaintext
I'm not sure where it would be today on that list, but I got pretty
competitive results for local tests on Linux a few years back. However,
there are at least two performance related issues still present:
- The API uses internal allocation of memory for I/O operations and per
socket descriptor. This is to work around the lack of a way to disable
struct moves (and thus making it unsafe to store any kind of pointer to
stack values). The allocations are pretty well optimized, but it does
lead to some additional memory copies that impede performance.
- On both, Linux and Windows, there are new, faster I/O APIs: io_uring
and RIO. A PR by Tobias Pankrath
(https://github.com/vibe-d/eventcore/pull/175) for io_uring exists, but
it still needs to be finished.
Another thing that needs to be tackled is better error propagation.
Right now, there is often just a generic "error" status, without the
possibility to get a more detailed error code or message.
By the way, although the vibe.d HTTP implementation naturally adds some
overhead over the raw network I/O, the vibe.d results in that list,
judging by their poor performance on many-core machines, appear to be
affected by GC runs, or possibly some other lock contention, whereas the
basic HTTP request handling should be more or less GC-free. So those
shouldn't be used for comparison.
More information about the Digitalmars-d
mailing list