Project: springxd
Issue XD-2175: Throughput in a stream with any processor
One of the goal for a micro benchmark is to compare throughput difference between two types of streams: 1. source | sink 2. source | processor | sink For this test I used reactor-tcp source, throughput-sampler as sink and created a NoOp processor. Tests were performed on a single node container with direct binding turned on for all streams. 1. Throughput for "source|sink" {noformat} stream create reactortcp --definition "reactor-ip --transport=tcp --port=4000 | throughput-sampler" stream deploy reactortcp --properties module.*.count=0 {noformat} On my system I get following numbers: Throughput sampled for 5000000 items: 345423/s in 14475ms elapsed time 2. Throughput for "source|processor|sink" Code for NoOpProcessor is available here: https://github.com/parikhkc/xd-noop-processor {noformat} stream create reactornoop --definition "reactor-ip --transport=tcp --port=5000 | noopprocessor | throughput-sampler" stream deploy reactornoop --properties module.*.count=0 {noformat} On the same system the throughput reduces to less then 70K/sec. Throughput sampled for 5000000 items: 67250/s in 74349ms elapsed time Yourkit shows 50% of CPU time on following thread: {noformat} * ringBuffer-17 [RUNNABLE] [DAEMON] java.lang.reflect.Method.getParameterAnnotations() Method.java:770 org.springframework.xd.integration.reactor.net.NetServerInboundChannelAdapter$1.accept(Object) NetServerInboundChannelAdapter.java:53 reactor.net.AbstractNetChannel$3.accept(Event) AbstractNetChannel.java:131 reactor.net.AbstractNetChannel$3.accept(Object) AbstractNetChannel.java:128 reactor.event.routing.ArgumentConvertingConsumerInvoker.invoke(Consumer, Class, Object) ArgumentConvertingConsumerInvoker.java:73 reactor.event.routing.ConsumerFilteringEventRouter.route(Object, Event, List, Consumer, Consumer) ConsumerFilteringEventRouter.java:78 reactor.event.dispatch.AbstractLifecycleDispatcher.route(AbstractLifecycleDispatcher$Task) AbstractLifecycleDispatcher.java:64 reactor.event.dispatch.AbstractSingleThreadDispatcher$SingleThreadTask.run() AbstractSingleThreadDispatcher.java:50 reactor.event.dispatch.RingBufferDispatcher$3.onEvent(RingBufferDispatcher$RingBufferTask, long, boolean) RingBufferDispatcher.java:115 reactor.event.dispatch.RingBufferDispatcher$3.onEvent(Object, long, boolean) RingBufferDispatcher.java:112 com.lmax.disruptor.BatchEventProcessor.run() BatchEventProcessor.java:128 java.lang.Thread.run() Thread.java:745 {noformat}
Story points: 1