XRT 2 Queue Throughput Samples
For handing data between producers and consumers, queues offer both per-item and batched interfaces. Batch reservation amortizes validation and atomic-coordination costs over a group of elements — a good fit for high-throughput workloads that aggregate naturally.
Lightweight data transfer between one producer and one consumer.
Four producers aggregate work, received by a single consumer.
Four producers and four consumers process queue data together.
Medians of three runs from the benchmark archived on 2026-07-28 (rounded), in queue elements per second. The environment and workload follow.
Hardware & System
AMD Ryzen 5 5600
6 cores / 12 logical processors
Windows 10 Pro 10.0.19045 x64
Build & Execution
GCC 16.1.0 · C11-O2 -Wall -Wextra -Werror
Serial sampling, no CPU pinning
Workload & Statistics
500,000 elements per producer
Capacity 4,096 · batch size 32
3 independent samples, median taken
Full Samples
The table scrolls horizontally. Per-run values are kept so comparisons under identical conditions stay possible.
| Queue path | Sample 1 | Sample 2 | Sample 3 | Median |
|---|---|---|---|---|
| SPSC | 28,156,799.586 | 28,811,967.339 | 30,437,879.332 | 28,811,967.339 |
| MPSC | 8,135,048.310 | 9,488,260.176 | 8,070,233.629 | 8,135,048.310 |
| MPSC batch 32 | 98,299,903.175 | 98,070,463.628 | 117,955,825.543 | 98,299,903.175 |
| MPMC | 6,591,453.785 | 6,627,232.425 | 6,689,527.010 | 6,627,232.425 |
| MPMC batch 32 | 125,923,967.109 | 136,885,043.940 | 134,432,091.629 | 134,432,091.629 |
Archived source: XRT 2 Queue Throughput Baseline · recorded at commit aff1ac5a549a.
Engineering Choices Behind the Numbers
Platform-native network backends
IOCP, epoll, kqueue, io_uring, and select converge into one port abstraction: applications keep a single interface while each backend exploits its platform.
Network engine API →Batching and memory reuse
Batched queue interfaces, object pools, temporary arenas, and reference-counted buffers offer several ways to organize data, cutting repeated allocation and coordination costs.
Queue API →Cryptographic hardware acceleration
The AES implementation ships x86 AES-NI / PCLMUL and ARM AES / PMULL accelerated paths, detecting processor capabilities at runtime.
Crypto primitives API →Bringing the Efficient Foundation into Network Applications
xhttp composes HTTP connection pooling, streaming send/receive, and a server runtime; xws composes WebSocket connection management, broadcast, and reference-based sending. The kernel provides the base data paths; extension libraries organize domain capabilities.
Reproduce in Your Environment
Clone the repository, check out the benchmark's recorded commit, and run the bundled script in Windows PowerShell. With a GCC reachable from PATH, run three times in a row and keep the outputs.
git clone https://gitee.com/xywhsoft/xrt.git xrt-queue-bench
cd xrt-queue-bench
git checkout aff1ac5a549aaa0e2759e9af376f68a85e71261e
for ($sample = 1; $sample -le 3; ++$sample) {
powershell.exe -NoProfile -ExecutionPolicy Bypass -File dev/bench/run_queue_bench_windows.ps1
}