Skip to content

Repository files navigation

Multi-Language Queue Benchmark

Site Dashboard License: MIT Languages

Compare in-process queue libraries across Python, Rust, JavaScript, C#, and C.

Start here
Home Documentation
Numbers Live dashboard
Experiments One-question tests
Benchmarks Design · Methodology · Metrics

Who it is for

Audience Use case
Students Queue types, backpressure, what “fast” actually means
System integrators Pick an in-process queue that fits the runtime
Researchers Reproducible measurement and one-question experiments
Library authors Add a queue, version A/B, regression checks

Supported languages

  • Cmutex-queue, lfqueue, spsc-ring
  • C# (.NET)Queue+lock, ConcurrentQueue, BlockingCollection, Channel
  • JavaScriptArray, denque, yocto-queue, fastq, p-queue (scheduler)
  • Pythondeque-lock, queue.Queue, queue.SimpleQueue, asyncio.Queue, janus, spsc-ring
  • Ruststd-mpsc, crossbeam-channel, flume, tokio-mpsc, async-channel, crossbeam-queue

Adding a language · Adding a queue.

This suite measures local queues on one machine. Compare inside one language and one communication category: thread, async, and opt-in process / IPC, shared memory, and durable / disk. Network brokers (Redis, Kafka, ZeroMQ) need a different lab — never on the same chart as deque-lock.


Try it: benchmark Python queues in ~60 seconds

Requires a recent Python 3 and uv (or pip). No Docker.

git clone https://github.com/leo-gan/queue-benchmark.git
cd queue-benchmark

./scripts/check-host-requirements.sh python   # optional: see what's missing
./scripts/install-host-requirements.sh python # optional: user-local toolchains

cd python && ./scripts/run-benchmarks.sh smoke
# → logs/python/YYYY-MM-DD-HHMMSS.csv

Then run analyze-benchmarks -l python after installing the analysis package.

Prefer Rust? ./scripts/run-all-benchmarks.sh --mode smoke --lang rust


Quick start

Benchmark runners run natively on the host (no Docker). Prepare toolchains once, then run (project deps like uv sync / npm install still happen inside each runner).

# 1) Host toolchains (compilers/runtimes only)
./scripts/check-host-requirements.sh
./scripts/install-host-requirements.sh
./scripts/install-host-requirements.sh csharp   # one language

# 2) Smoke one language
./python/scripts/run-benchmarks.sh smoke
# or: ./rust/scripts/run-benchmarks.sh smoke

# Orchestrator: all languages or one language
./scripts/run-all-benchmarks.sh --mode all-single
./scripts/run-all-benchmarks.sh --mode full --lang rust

# Analysis package (writes reports/; Dashboard via sync-data.py)
cd analysis && uv pip install -e .   # or: pip install -e .
analyze-benchmarks
analyze-benchmarks -l python
analyze-benchmarks --compare-a rust:2026-08-31-120000 --compare-b rust:latest

Modes: smoke (2 reps) · all-single (10) · full (100) · research (500).

analyze-benchmarks writes reports/; Dashboard via sync-data.py. Review and commit before publish-docs deploys the site.


Test data

Shared payload sizes: 256 B (size_256) and 4 KiB (size_4096). Every runner builds an opaque byte string of that length.

Catalog and defaults: schemas/data_catalog_v2.yaml. Run matrices: config/library/.


Statistics

Compare queues within one language and one category. Cross-language absolute times are directional only — runtimes and GCs differ. Comparison rules: no global winner, no broker next to deque-lock.


CSV contract

Every language writes the same columns (nanoseconds). Domain mapping:

Column Queue meaning
LibraryName / LibraryVersion Implementation + installed version
TimeEnq Enqueue ns
TimeDeq Dequeue ns
TimeHandoff Handoff ns
Pattern bytes = 1P1C, 4p4c = 4P4C (stream is leftover 2P2C, not I/O)
CpuTimeNs Process CPU time (spin vs block)

See Metrics and architecture.


Authored by Leonid Ganeline

About

Multi-language benchmark for the queue libraries.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages