.. /index

LMAX Disruptor

LMAX Disruptor

The Disruptor is the gold standard for bounded pipeline latency, created by Martin Thompson et al. at LMAX Exchange. Its pre-allocated ring-buffer with sequence-number-based coordination achieves 52 ns mean latency per hop and 128 ns at the 99th percentile — compared to 32,757 ns mean and 2,097,152 ns p99 for Java's ArrayBlockingQueue. That is 630× lower mean latency and 8× higher throughput (26M vs 5.3M ops/s in 1P/1C). LMAX itself processes 6 million orders per second on a single JVM thread. The Disruptor is also the canonical demonstration of mechanical-sympathy: a Java program that beats most C/C++ queues purely by aligning every design decision with the underlying hardware.

Where the Disruptor sits in 2025

The Disruptor is not the absolute throughput champion — for raw MPMC throughput, LCRQ + aggregating-funnels (PPoPP 2025) wins by a wide margin, and a fully-optimized C++ SPSC ring buffer hits 200–500M ops/s versus the Disruptor's 26M. What the Disruptor wins is latency tail in bounded pipeline topologies: pre-allocated objects, single-writer principle, mechanical-sympathy padding, and the ability for multiple consumers to read the same event without locking.

Use case Best choice
Lowest tail latency in a bounded pipeline LMAX Disruptor
Max strict-FIFO MPMC throughput on x86 lcrq + aggregating-funnels
Max strict-FIFO MPMC, portable scq / lprq
Wait-free MPMC wcq
One-producer, one-consumer raw throughput spsc-queue (rtrb, atomic_queue)
C++ MPMC, relaxed FIFO moodycamel-concurrent-queue

Design: mechanical sympathy

The Disruptor embodies mechanical sympathy — designing software that works with the hardware rather than against it:

Latency comparison

Metric ArrayBlockingQueue LMAX Disruptor
Throughput (1P/1C) 5.3M ops/s 26.0M ops/s
Mean latency 32,757 ns 52 ns
99th percentile latency 2,097,152 ns 128 ns

The 16,000× p99 advantage is the headline. ArrayBlockingQueue's tail is dominated by lock contention and GC pauses; the Disruptor has neither.

Java vs C++ at the inter-thread layer

A widely-cited Martin Thompson benchmark: Java volatile ping-pong runs at 50 ns per operation, C++ std::atomic ping-pong at 45 ns on identical hardware. The 10% gap is rounding error compared to the 100× cost of a single algorithmic mistake. Both languages emit LOCK-prefixed x86 instructions and bottleneck on the same MESI/MOESI protocol. The Disruptor's 52 ns/hop in Java is what makes the point: at the inter-thread layer, the hardware sets the speed and the language barely matters. See inter-thread-communication for the broader cross-language convergence data.

When to use it

The Disruptor pattern is ideal when:

It is not the best choice when:

For read-dominated workloads, RCU achieves even lower overhead — effectively zero on the read side.

Implementations

See also

Linked from

Sources