Skip to content

[Community] disruptor-cpp: Complete 1:1 C++ port with all tests and real-world exchange example #507

@justinzhuguangwen

Description

@justinzhuguangwen

Hi LMAX team,

I've created a complete 1:1 C++ port of the Disruptor pattern:

Repository: https://github.com/SkynetNext/disruptor-cpp

What's Included

  • Complete API port: All core components under include/disruptor/**

    • RingBuffer, Sequencer, WaitStrategy, BatchEventProcessor, etc.
    • Namespaces: disruptor, disruptor::dsl, disruptor::util
  • All Java tests migrated: Ported to GoogleTest under tests/disruptor/**

  • JMH-aligned benchmarks: C++ benchmarks under benchmarks/jmh/** using Google Benchmark

    • SingleProducerSingleConsumer
    • MultiProducerSingleConsumer
    • BlockingQueueBenchmark
    • Directly comparable to Java JMH results

Real-World Usage

Used in exchange-cpp, a high-performance matching engine (C++ port of exchange-core):

  • Sub-microsecond order processing latency
  • Same multi-stage pipeline architecture (R1 → ME → R2 → E)

Benchmark Comparison

The project includes scripts to run both Java JMH and C++ benchmarks side-by-side for fair comparison. See docs/BENCHMARK_RESULTS.md.

Would you consider adding a link to this project in your README under community ports or related projects?

Happy to discuss any technical details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions