A high-performance, low-latency C++ library for inter-thread communication, featuring a 1:1 C++ port of LMAX Disruptor (API + tests), plus aligned C++ benchmarks for fair comparison against Java JMH.
- Disruptor (C++ port):
include/disruptor/**with namespacesdisruptor,disruptor::dsl,disruptor::util - Tests: Java tests ported to GoogleTest under
tests/disruptor/** - Benchmarks: JMH-aligned C++ benchmarks under
benchmarks/jmh/**(Google Benchmark), comparable to Java JMH results
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .| Test | C++ | Java | C++/Java |
|---|---|---|---|
| SPSC | 310.6 Mops/sec | 138.9 Mops/sec | 2.24x ⬆️ |
| MPSC (Single Event) | 51.4 Mops/sec | 36.1 Mops/sec | 1.42x ⬆️ |
| MPSC (Batch) | 291.6 Mops/sec | 208.1 Mops/sec | 1.40x ⬆️ |
| SPSC End-to-End | 260 Mops/sec | 155 Mops/sec | 1.68x ⬆️ |
| Test | C++ | Java | C++/Java |
|---|---|---|---|
| SPSC | 3.22 ns/op | 7.197 ns/op | 0.45x ⬇️ (faster) |
Results from GitHub Actions CI (4 cores, 3244 MHz). See Benchmark Results for detailed data.
- Benchmark Results:
docs/BENCHMARK_RESULTS.md - Build Guide:
docs/BUILD_GUIDE.md
./build/tests/disruptor_cpp_tests # Unit tests
./build/benchmarks/disruptor_cpp_benchmarks # Performance benchmarks
./build/examples/basic_example # Usage exampleLicensed under the Apache License 2.0. See LICENSE for details.
- LMAX Disruptor - Ultra-fast inter-thread messaging
- Aeron - High-performance messaging transport