Benchmarking Conversant Disruptor
The mean time for 1M transfers on ordinary hardware is 10ms. The multithread implementation averages 45ms.
In comparison, LMAX exhibited 22ms for single thread and 55ms in multithread mode. The
BlockingQueues available in the Oracle JDK are not on par with either Disruptor.
ArrayBlockingQueue consumes 300ms per million transfers, while
LinkfedTransferQueue a CAS protected LinkedList can obtain 151ms for 1M transfers on average.
This benchmark uses JMH. JMH is a framework for microbenchmarking in Java. The same code is used for each
BlockingQueue. However, LMAX Disruptor requires event preallocation as part of the queue configuration. We made an effort to keep the LMAX implementation as comparable as is possible within known API differences.
The test hardware is a consumer grade laptop, Intel Core i7-4600U @ 2.1Ghz. Better performance could easily be attained on enterprise class hardware. A thread pool is created with one thread per available processor, then information in the form of a Java
Long is passed from the producer to the consumer via the queue. After processing a long sequence, 1 million entries, the total time to transfer all items is measured and the per transfer time is calculated.
Our simple benchmark shows that with almost no configuration or specialized setup Conversant Disruptor is capable of 20ns push-pull transfers and 45ns multithread. Conversant Disruptor is ideal for any high performance application where either high volume or low latency is required. Example applications include extreme volume HTTP environments, financial exchanges, log offload processing, actor-reactor event processing and more.
This work confirms work done by Sabarish Sasidharan., and extends it to include Conversant Disruptor.
Conversant Disruptor is available on github.