Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
The Disruptor High Performance Inter-Thread Messaging Michael Barker @mikeb2701 Lead Developer LMAXThursday, 17 November 11
Mo’vember   • Apologies for the silly facial hair   • Raising money for men’s health   • Donate!!!                    http...
What is the                                         Disruptor?                           http://code.google.com/p/disrupto...
static long foo = 0;                private static void increment() {                    for (long l = 0; l < 500000000L; ...
public static long foo = 0;                  public static Lock lock = new Lock();                  private static void in...
static AtomicLong foo = new AtomicLong(0);           private static void increment() {               int iterations = 5000...
Increment a counter 500 000 000 times.        • One Thread                     :     300 msThursday, 17 November 11
Increment a counter 500 000 000 times.        • One Thread                    :      300 ms        • One Thread          (...
Increment a counter 500 000 000 times.        • One Thread                    :      300 ms        • One Thread          (...
Increment a counter 500 000 000 times.        •    One           Thread             :      300   ms        •    One       ...
Increment a counter 500 000 000 times.        •    One           Thread              :        300   ms        •    One    ...
Increment a counter 500 000 000 times.        •    One           Thread              :     300 ms        •    One         ...
Thursday, 17 November 11
Test                         Queue       Disruptor     Factor      OnePublisherToOneProcessorUniCastThroughputTest       2...
Demo: Concert Tickets...                                <event>             <event>                                       ...
Demo: Concert Tickets...                                              Concert                                             ...
Upcoming SlideShare
Loading in …5
×

Disruptor tools in action

15,848 views

Published on

  • The #1 Woodworking Resource With Over 16,000 Plans, Download 50 FREE Plans...  http://t.cn/A6hKwqcb
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ❶❶❶ http://bit.ly/369VOVb ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Follow the link, new dating source: ❶❶❶ http://bit.ly/369VOVb ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL eBOOK INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • The #1 Woodworking Resource With Over 16,000 Plans, Download 50 FREE Plans... ■■■ http://tinyurl.com/y3hc8gpw
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Disruptor tools in action

  1. 1. The Disruptor High Performance Inter-Thread Messaging Michael Barker @mikeb2701 Lead Developer LMAXThursday, 17 November 11
  2. 2. Mo’vember • Apologies for the silly facial hair • Raising money for men’s health • Donate!!! http://mobro.co/mikeb2701 2Thursday, 17 November 11
  3. 3. What is the Disruptor? http://code.google.com/p/disruptorThursday, 17 November 11
  4. 4. static long foo = 0; private static void increment() { for (long l = 0; l < 500000000L; l++) { foo++; } }Thursday, 17 November 11
  5. 5. public static long foo = 0; public static Lock lock = new Lock(); private static void increment() { int iterations = 500000000L / THREADS; for (long l = 0; l < iterations; l++){ lock.lock(); try { foo++; } finally { lock.unlock(); } } }Thursday, 17 November 11
  6. 6. static AtomicLong foo = new AtomicLong(0); private static void increment() { int iterations = 500000000L / THREADS; for (long l = 0; l < iterations; l++) { foo.getAndIncrement(); } }Thursday, 17 November 11
  7. 7. Increment a counter 500 000 000 times. • One Thread : 300 msThursday, 17 November 11
  8. 8. Increment a counter 500 000 000 times. • One Thread : 300 ms • One Thread (volatile): 4 700 ms (15x)Thursday, 17 November 11
  9. 9. Increment a counter 500 000 000 times. • One Thread : 300 ms • One Thread (volatile): 4 700 ms (15x) • One Thread (Atomic) : 5 700 ms (19x)Thursday, 17 November 11
  10. 10. Increment a counter 500 000 000 times. • One Thread : 300 ms • One Thread (volatile): 4 700 ms (15x) • One Thread (Atomic) : 5 700 ms (19x) • One Thread (Lock) : 10 000 ms (33x)Thursday, 17 November 11
  11. 11. Increment a counter 500 000 000 times. • One Thread : 300 ms • One Thread (volatile): 4 700 ms (15x) • One Thread (Atomic) : 5 700 ms (19x) • One Thread (Lock) : 10 000 ms (33x) • Two Threads (Atomic) : 17 000 ms (58x)Thursday, 17 November 11
  12. 12. Increment a counter 500 000 000 times. • One Thread : 300 ms • One Thread (volatile): 4 700 ms (15x) • One Thread (Atomic) : 5 700 ms (19x) • One Thread (Lock) : 10 000 ms (33x) • Two Threads (Atomic) : 17 000 ms (58x) • Two Threads (Lock) : 104 000 ms (345x) ^^^^^^^^ > 1.5 minutes!!!Thursday, 17 November 11
  13. 13. Thursday, 17 November 11
  14. 14. Test Queue Disruptor Factor OnePublisherToOneProcessorUniCastThroughputTest 2,366,171 72,087,993 30.5 OnePublisherToThreeProcessorDiamondThroughputTest 1,590,126 63,358,798 39.8 OnePublisherToThreeProcessorMultiCastThroughputTest 191,661 54,165,692 282.6 OnePublisherToThreeProcessorPipelineThroughputTest 1,289,199 71,562,125 55.5 OnePublisherToThreeWorkerPoolThroughputTest 2,175,593 10,412,567 4.8Thursday, 17 November 11
  15. 15. Demo: Concert Tickets... <event> <event> Concert Concert Ticket Repository Created Purchase Concert <entity> Service Concert <event> <event> <event> <event> <entity> Concert Allocation Allocation Section Section Created Rejected Approved Updated 15Thursday, 17 November 11
  16. 16. Demo: Concert Tickets... Concert Service UDP UDP Request Response Servlet Servlet HTTP Long Poll HTTP Client 16Thursday, 17 November 11

×