Posts Tagged ‘Disruptor-net’

h1

Disruptor-Net after 2 weeks

August 24, 2016

I have been using the disruptor now in my main libs. Each day the RingBuffers are used 300-400 Mio times per day without any issues.

I realized that there multiple disruptor implementations on Nuget.

I personally use this implementation. The implementation is based on the latest Java API and thus it required a small change as the IEventHandler interface changed its name from OnNext to OnEvent.

h1

Disruptor-Net: First experience

August 5, 2016

Yesterday I have taken the Disruptor-Net  into production at a first criticial part of one of my applications. A great general overview of the pattern can be found in Martin Fowler’s blog.

The general plan for me is to get rid of BlockingCollection and use this instead. Fortunately I usually use the ConsumingEnumerable and thus the migration is easy and requires most of the work on the objects which are pushed to the queue to support update operations for object reuse.

I took this example as a guideline. Unfortunately the number of C# examples is limited. This is rather simple, but it feels a bit unelegant and clumpsy as it is very Java-ish, so I might look again at getting it more idiomatic and with less noise in the code. A BlockingCollection requires one class and this implementation requires three – I hope to get it down to two again to get rid of the EventHandler class and use delegates instead.

Performance is always about seeing for believing and it did look good. Using efficient collection is a great and rather safe way to improve the performance and latency.