Multi-threaded and highly concurrent 10-JMH, Disruptor

Jnः

Code performance can be tested. The method of testing throughput.

QPS,TPS

QPS: Queries Per Second is the acronym, meaning that the rate of queries per second (maximum throughput)
TPS: Transactions Per Second is the abbreviation, that is, the number of transactions / sec (maximum capacity)

Disruptor basic theory

Disintegration of
high performance, single-threaded processing 6 million orders per second,
the fastest MQ, no lock CAS, stand-alone support high-concurrency

Conventional queues have different structures, the use of an annular Buffer.
List of query speed is definitely slower than the array, compare ConcurrentLinkedQueue: linked list implementation, JDK in but did not ConcurrentArrayQueue, because the array length is fixed, increase the queue elements will be very troublesome.

Disruptor array is implemented, and the ending is connected, directly cover (not clear) of old data, is covered with eight kinds of strategy is most Blockingwait, can reduce the frequency of GC.

That RingBuffer, implemented using an array, there is no ending pointers. Like length hashMap, N power requirements are 2Here Insert Picture Description

Published 25 original articles · won praise 0 · Views 577

Guess you like

Origin blog.csdn.net/RaymondCoder/article/details/105145320