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.

SPSC · per-item
28.81M items/s

Lightweight data transfer between one producer and one consumer.

MPSC · batch 32
98.30M items/s

Four producers aggregate work, received by a single consumer.

MPMC · batch 32
134.4M items/s

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.

XRT 2 queue, three throughput samples, in items/s
Queue pathSample 1Sample 2Sample 3Median
SPSC28,156,799.58628,811,967.33930,437,879.33228,811,967.339
MPSC8,135,048.3109,488,260.1768,070,233.6298,135,048.310
MPSC batch 3298,299,903.17598,070,463.628117,955,825.54398,299,903.175
MPMC6,591,453.7856,627,232.4256,689,527.0106,627,232.425
MPMC batch 32125,923,967.109136,885,043.940134,432,091.629134,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.

PowerShell · run inside a dedicated benchmark directory
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
}

Benchmark C source · Runner script