TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Disruptor: High performance alternative to bounded queues (2011) [pdf]

99 pointsby cjgalmost 9 years ago

7 comments

lomnakkusalmost 9 years ago
See also Aeron[1] which is basically a networked superset of the Disruptor, featuring (IIRC) a just-as-fast machine-local implementation. Made by some of the same people as the LMAX Disruptor. It&#x27;s not <i>quite</i> ready for general use AFAICT, but it&#x27;s quickly getting there...<p>There&#x27;s also a really informative presentation[2] by Martin Thompson on some of the ideas that they&#x27;re using to get really low latency and high throughput.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;real-logic&#x2F;Aeron" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;real-logic&#x2F;Aeron</a><p>[2] <a href="https:&#x2F;&#x2F;www.infoq.com&#x2F;presentations&#x2F;aeron-messaging" rel="nofollow">https:&#x2F;&#x2F;www.infoq.com&#x2F;presentations&#x2F;aeron-messaging</a>
评论 #12059577 未加载
评论 #12057677 未加载
评论 #12061233 未加载
vogalmost 9 years ago
I really don&#x27;t want to put this down. This looks very interesting and is nicely presented. But I have trouble recognizing the main idea(s) behind the &quot;LMAX Disruptor&quot;. To me, this all boils down to:<p>&quot;You get better performance if you implement your event queue via a pre-allocated ring buffer instead of (dynamically allocated) linked-lists or arrays.&quot;<p>Is it really just that? If so, this is nothing new, but quite common in game programming and related fields. For example, see: <a href="https:&#x2F;&#x2F;fgiesen.wordpress.com&#x2F;2010&#x2F;12&#x2F;14&#x2F;ring-buffers-and-queues&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fgiesen.wordpress.com&#x2F;2010&#x2F;12&#x2F;14&#x2F;ring-buffers-and-qu...</a><p>What am I missing?
评论 #12057177 未加载
评论 #12055962 未加载
评论 #12057529 未加载
评论 #12055967 未加载
评论 #12061036 未加载
评论 #12055941 未加载
danbrucalmost 9 years ago
ArrayBlockingQueue [1] uses a ring buffer backed by a fixed-size array, too. It is really hard to say where the speed-up comes from without seeing the code, but it is certainly not from using a ring buffer because both of the compared implementations do so. I guess they just were more careful when they designed the auxiliary state and the operation on it, for example ArrayBlockingQueue explicitly tracks the number of elements in the queue with a separate field - instead of deriving it from the insert and remove pointers - and therefore this field is contented by readers and writers. Also preallocating entries for all slots to work around Java&#x27;s lack of support for arrays of value types certainly removes some overhead from the allocator.<p>EDIT: Just realized that the code is on GitHub - will have a look.<p>[1] <a href="http:&#x2F;&#x2F;grepcode.com&#x2F;file&#x2F;repository.grepcode.com&#x2F;java&#x2F;root&#x2F;jdk&#x2F;openjdk&#x2F;6-b14&#x2F;java&#x2F;util&#x2F;concurrent&#x2F;ArrayBlockingQueue.java" rel="nofollow">http:&#x2F;&#x2F;grepcode.com&#x2F;file&#x2F;repository.grepcode.com&#x2F;java&#x2F;root&#x2F;j...</a>
评论 #12059225 未加载
eelanalmost 9 years ago
That is an old presentation. The most up to date info can be found at <a href="https:&#x2F;&#x2F;github.com&#x2F;LMAX-Exchange&#x2F;disruptor&#x2F;wiki&#x2F;Introduction" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;LMAX-Exchange&#x2F;disruptor&#x2F;wiki&#x2F;Introduction</a>
lmbalmost 9 years ago
There is a podcast at [1] where the author of the disruptor is interviewed.<p>1: <a href="http:&#x2F;&#x2F;www.se-radio.net&#x2F;2016&#x2F;04&#x2F;se-radio-episode-254-mike-barker-on-the-lmax-architecture&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.se-radio.net&#x2F;2016&#x2F;04&#x2F;se-radio-episode-254-mike-ba...</a>
dintechalmost 9 years ago
Also take a look at:<p><a href="http:&#x2F;&#x2F;chronicle.software&#x2F;products&#x2F;chronicle-queue&#x2F;" rel="nofollow">http:&#x2F;&#x2F;chronicle.software&#x2F;products&#x2F;chronicle-queue&#x2F;</a>
irishjohnniealmost 9 years ago
It&#x27;s been a while, but didn&#x27;t the performance turn out to be similar to other data structures in multi-socket scenarios because it requires interlocked -type instructions?