@ Benchmark public long notJmhEventLoop ( StreamObjects streamObjects ) throws Exception { ANOTHER_EVENT_LOOP . execute ( ( ) -> { final StreamMessage < Integer > stream = newStream ( streamObjects ) ; stream . subscribe ( streamObjects . subscriber , ANOTHER_EVENT_LOOP ) ; streamObjects . writeAllValues ( stream ) ; } ) ; streamObjects . completedLatch . await ( 10 , TimeUnit . SECONDS ) ; return streamObjects . computedSum ( ) ; }
to compare approaches .