jmh - Benchmark results ForkJoin vs Disruptor? -
i have run disruptovsfj mirco-benchmarks written aleskey shipilev
, forkjoin , disruptor library performance compared.
the results have using jdk1.8.40 on linux platform i5:
benchmark score, score error (99.9%),unit,param: slicesk, disruptor.run, 939.801405, 20.741961,ms/op, 50000,0,10 forkjoin.run, 1175.263451, 0.595711, ms/op, 50000,0,10 forkjoinrecursive.run 771.854028, 26.022542,ms/op, 50000,0,10 forkjoinrecursivedeep.run, 1356.697011, 28.666325,ms/op, 50000,0,10 forkjoinreuse.run, 7974.180793, 49.604539,ms/op, 50000,0,10
the first part of results slicesk < 50000
expected disruptor
using ringbuffer , mechanism makes efficient in concurrent context.
now when slicesk >= 50000
disruptor
test less performant forkjoinrecursivedeep, , forkjoinreuse. can explain me results ? thank you
answer :
your disruptor usable ring buffer somehow full @ slicesk >= 50000 cause performance drop.
notes :
for high performance ring buffer, , contents, should fit in l3 cpu cache exchanging between threads. if ring buffer used replay scenario, such market data or network recovery, may larger , have obvious performance implications cache misses.
one of sequencer's roles ensure publication not wrap ring buffer. none of downstream consumer may have sequence lower ring buffer's sequence less size of ring buffer. using graph of dependencies interesting optimization can made
------------------- ^ thread 1 ^ ------------------------------------------------------------ ^ thread 2 ^ ----------
links :
dissecting disruptor : what's special ring buffer ?
wiki : circular buffer (disruptor not use pointers)
Comments
Post a Comment