It is a bit tricky to benchmark WebSocket libraries, since you're going to be limited by the speed of the slower end (i.e. benchmarking a server requires an even faster client and vice-versa). The uWebSockets library for C/C++ comes with a benchmarking tool called load_test that should be fast enough not to bottleneck all currently known WebSocket library implementations and has been used for these benchmarks.
The benchmarks are run irregularly on a bunch of different systems to get a rough idea for the scaling of the library on different hardware. All hardware is bare-metal, not virtualized.
All benchmarks are run in a podman container based on Chimera Linux.
We're comparing some popular Rust WebSocket libraries to tokio-websockets and uWebSockets as a reference. All of the implementations are asynchronous. For benchmarking we use a simple plaintext echo server.
In order to bottleneck faster, we're also using a single-threaded runtime.
The following libraries are compared (in alphabetical order):
- fastwebsockets (unsound and not thread-safe, non-strict spec compliance)
- tokio-tungstenite (non-strict spec compliance)
- tokio-websockets (strict spec compliance)
- uWebSockets (non-strict spec compliance)
The benchmarking script was taken from fastwebsockets and modified.
This target uses AVX2 to emulate AVX512 in hardware.
Expand results
This target uses NEON.











