Skip to content

Instantly share code, notes, and snippets.

@Janmm14
Last active June 21, 2021 15:08
Show Gist options
  • Save Janmm14/7d3b5ee3937996a162f4183c8e3877b3 to your computer and use it in GitHub Desktop.
Save Janmm14/7d3b5ee3937996a162f4183c8e3877b3 to your computer and use it in GitHub Desktop.
test with single EventBus, multiple listener and also consuming after event call
Reflection: Lambda:
Benchmark Mode Cnt Score Error Units Score Error Units
SpeedTest.bench01_Blackhole thrpt 5 42639,522 ± 71,873 ops/ms 87550,440 ± 173,872 ops/ms
SpeedTest.bench02_Event thrpt 5 317972,720 ± 940,454 ops/ms 375898,768 ± 2543,707 ops/ms
SpeedTest.bench03_Event2 thrpt 5 41659,581 ± 57,944 ops/ms 74706,716 ± 31,157 ops/ms
SpeedTest.bench03a_Event2 thrpt 5 218640,423 ± 151,935 ops/ms 218658,005 ± 533,663 ops/ms
SpeedTest.bench04_Event2 thrpt 5 41641,909 ± 875,904 ops/ms 72745,461 ± 121,890 ops/ms
SpeedTest.bench04a_Event2 thrpt 5 244316,722 ± 1263,248 ops/ms 244601,339 ± 35,782 ops/ms
SpeedTest.bench05_Event2 thrpt 5 41841,968 ± 91,409 ops/ms 74581,825 ± 42,360 ops/ms
SpeedTest.bench05a_Event2 thrpt 5 244563,638 ± 270,481 ops/ms 244608,109 ± 34,251 ops/ms
SpeedTest.bench06_2Event thrpt 5 40834,405 ± 33,291 ops/ms 70078,158 ± 31,983 ops/ms
SpeedTest.bench06_Event2 thrpt 5 62189,099 ± 22,164 ops/ms 85828,583 ± 198,701 ops/ms
SpeedTest.bench06a_New2 thrpt 5 211178,080 ± 444,058 ops/ms 211195,854 ± 209,842 ops/ms
SpeedTest.bench07_3 thrpt 5 37572,239 ± 99,643 ops/ms 61816,144 ± 346,296 ops/ms
package net.md_5;
import java.util.concurrent.TimeUnit;
import net.md_5.bungee.event.EventBus;
import net.md_5.bungee.event.EventHandler;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.CompilerControl;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
@Fork(1)
@State(Scope.Benchmark)
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Warmup(iterations = 4, time = 5)
@Measurement(iterations = 5, time = 10)
public class SpeedTest
{
public static EventBus bus = new EventBus();
public static Blackhole blackhole;
@Setup(Level.Iteration)
public void iterSetup(Blackhole blackhole)
{
SpeedTest.blackhole = blackhole;
}
@Setup
public void setup()
{
bus.register( new EvListener() );
bus.register( new EvListener2() );
bus.register( new EvListener3() );
}
@Benchmark
public void bench01_Blackhole(Blackhole event)
{
bus.post( event );
blackhole.consume( event );
}
@Benchmark
public void bench02_Event(Event event)
{
bus.post( event );
blackhole.consume( event );
}
@Benchmark
public void bench03_Event2()
{
Event2 event = new Event2( System.currentTimeMillis() );
bus.post( event );
blackhole.consume( event );
}
@Benchmark
public void bench03a_Event2()
{
Event2 event = new Event2( System.currentTimeMillis() );
blackhole.consume( event );
}
@Benchmark
public void bench04_Event2()
{
Event2 event = new Event2( System.currentTimeMillis() );
bus.post( event );
blackhole.consume( event.l );
}
@Benchmark
public void bench04a_Event2()
{
Event2 event = new Event2( System.currentTimeMillis() );
blackhole.consume( event.l );
}
@Benchmark
public void bench05_2Event3(Blackhole blackhole)
{
Event3 event = new Event3();
bus.post( event );
blackhole.consume( event );
}
@Benchmark
public void bench05a_New(Blackhole blackhole)
{
Event3 event = new Event3();
blackhole.consume( event );
}
@Benchmark
public void bench06_2Event_(Blackhole blackhole, Event event)
{
bus.post( blackhole );
blackhole.consume( blackhole );
bus.post( event );
blackhole.consume( event );
}
@Benchmark
public void bench10_3(Event event, Event event_, Blackhole blackhole)
{
bus.post( event );
blackhole.consume( event );
bus.post( blackhole );
blackhole.consume( blackhole );
bus.post( event_ );
blackhole.consume( event_ );
}
@State(Scope.Thread)
public static class Event
{
}
public static class Event2
{
private long l;
public Event2(long l)
{
this.l = l;
}
}
public static class Event3
{
}
public static class Event4
{
}
@SuppressWarnings("BungeeCordListenerImplemented")
public static class EvListener
{
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void onEvent(Event event)
{
SpeedTest.blackhole.consume( event );
}
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void onEvent(Event2 event)
{
SpeedTest.blackhole.consume( event.l );
}
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void onEvent(Event3 event)
{
SpeedTest.blackhole.consume( event );
}
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void onEvent(Blackhole event)
{
event.consume( event );
}
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void onEvent(Event4 event)
{
SpeedTest.blackhole.consume( event );
}
}
@SuppressWarnings("BungeeCordListenerImplemented")
public static class EvListener2
{
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void event(Event event)
{
SpeedTest.blackhole.consume( event );
}
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void event2(Event2 event)
{
SpeedTest.blackhole.consume( event.l );
}
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void blackhole(Blackhole event)
{
event.consume( event );
}
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void event3(Event3 event)
{
SpeedTest.blackhole.consume( event );
}
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void event4(Event4 event)
{
SpeedTest.blackhole.consume( event );
}
}
@SuppressWarnings("BungeeCordListenerImplemented")
public static class EvListener3
{
@EventHandler
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void event4(Event4 event)
{
SpeedTest.blackhole.consume( event );
}
}
}
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench01_Blackhole
# Run progress: 0,00% complete, ETA 00:14:00
# Fork: 1 of 1
# Warmup Iteration 1: 65117,937 ops/ms
# Warmup Iteration 2: 40630,956 ops/ms
# Warmup Iteration 3: 42635,237 ops/ms
# Warmup Iteration 4: 42639,972 ops/ms
Iteration 1: 42659,891 ops/ms
Iteration 2: 42644,927 ops/ms
Iteration 3: 42651,927 ops/ms
Iteration 4: 42614,654 ops/ms
Iteration 5: 42626,212 ops/ms
Result "net.md_5.SpeedTest.bench01_Blackhole":
42639,522 ±(99.9%) 71,873 ops/ms [Average]
(min, avg, max) = (42614,654, 42639,522, 42659,891), stdev = 18,665
CI (99.9%): [42567,650, 42711,395] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench02_Event
# Run progress: 8,33% complete, ETA 00:12:53
# Fork: 1 of 1
# Warmup Iteration 1: 265517,545 ops/ms
# Warmup Iteration 2: 273236,251 ops/ms
# Warmup Iteration 3: 317839,653 ops/ms
# Warmup Iteration 4: 318284,544 ops/ms
Iteration 1: 318160,291 ops/ms
Iteration 2: 318066,068 ops/ms
Iteration 3: 317861,884 ops/ms
Iteration 4: 317597,890 ops/ms
Iteration 5: 318177,465 ops/ms
Result "net.md_5.SpeedTest.bench02_Event":
317972,720 ±(99.9%) 940,454 ops/ms [Average]
(min, avg, max) = (317597,890, 317972,720, 318177,465), stdev = 244,233
CI (99.9%): [317032,265, 318913,174] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench03_Event2
# Run progress: 16,67% complete, ETA 00:11:43
# Fork: 1 of 1
# Warmup Iteration 1: 55383,355 ops/ms
# Warmup Iteration 2: 41251,412 ops/ms
# Warmup Iteration 3: 41633,877 ops/ms
# Warmup Iteration 4: 41643,986 ops/ms
Iteration 1: 41651,584 ops/ms
Iteration 2: 41681,811 ops/ms
Iteration 3: 41642,242 ops/ms
Iteration 4: 41656,545 ops/ms
Iteration 5: 41665,726 ops/ms
Result "net.md_5.SpeedTest.bench03_Event2":
41659,581 ±(99.9%) 57,944 ops/ms [Average]
(min, avg, max) = (41642,242, 41659,581, 41681,811), stdev = 15,048
CI (99.9%): [41601,638, 41717,525] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench03a_Event2
# Run progress: 25,00% complete, ETA 00:10:32
# Fork: 1 of 1
# Warmup Iteration 1: 205946,371 ops/ms
# Warmup Iteration 2: 208613,314 ops/ms
# Warmup Iteration 3: 218645,505 ops/ms
# Warmup Iteration 4: 218652,933 ops/ms
Iteration 1: 218622,112 ops/ms
Iteration 2: 218604,526 ops/ms
Iteration 3: 218609,455 ops/ms
Iteration 4: 218685,944 ops/ms
Iteration 5: 218680,076 ops/ms
Result "net.md_5.SpeedTest.bench03a_Event2":
218640,423 ±(99.9%) 151,935 ops/ms [Average]
(min, avg, max) = (218604,526, 218640,423, 218685,944), stdev = 39,457
CI (99.9%): [218488,487, 218792,358] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench04_Event2
# Run progress: 33,33% complete, ETA 00:09:22
# Fork: 1 of 1
# Warmup Iteration 1: 55073,810 ops/ms
# Warmup Iteration 2: 41903,738 ops/ms
# Warmup Iteration 3: 41746,157 ops/ms
# Warmup Iteration 4: 41749,917 ops/ms
Iteration 1: 41735,640 ops/ms
Iteration 2: 41745,126 ops/ms
Iteration 3: 41751,507 ops/ms
Iteration 4: 41742,145 ops/ms
Iteration 5: 41235,128 ops/ms
Result "net.md_5.SpeedTest.bench04_Event2":
41641,909 ±(99.9%) 875,904 ops/ms [Average]
(min, avg, max) = (41235,128, 41641,909, 41751,507), stdev = 227,469
CI (99.9%): [40766,005, 42517,813] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench04a_Event2
# Run progress: 41,67% complete, ETA 00:08:12
# Fork: 1 of 1
# Warmup Iteration 1: 230916,938 ops/ms
# Warmup Iteration 2: 232186,157 ops/ms
# Warmup Iteration 3: 244362,312 ops/ms
# Warmup Iteration 4: 244409,318 ops/ms
Iteration 1: 244409,388 ops/ms
Iteration 2: 244429,120 ops/ms
Iteration 3: 244414,434 ops/ms
Iteration 4: 243744,684 ops/ms
Iteration 5: 244585,983 ops/ms
Result "net.md_5.SpeedTest.bench04a_Event2":
244316,722 ±(99.9%) 1263,248 ops/ms [Average]
(min, avg, max) = (243744,684, 244316,722, 244585,983), stdev = 328,061
CI (99.9%): [243053,474, 245579,969] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench05_Event2
# Run progress: 50,00% complete, ETA 00:07:01
# Fork: 1 of 1
# Warmup Iteration 1: 55509,001 ops/ms
# Warmup Iteration 2: 41796,393 ops/ms
# Warmup Iteration 3: 41856,319 ops/ms
# Warmup Iteration 4: 41847,300 ops/ms
Iteration 1: 41858,857 ops/ms
Iteration 2: 41837,809 ops/ms
Iteration 3: 41860,770 ops/ms
Iteration 4: 41849,666 ops/ms
Iteration 5: 41802,741 ops/ms
Result "net.md_5.SpeedTest.bench05_Event2":
41841,968 ±(99.9%) 91,409 ops/ms [Average]
(min, avg, max) = (41802,741, 41841,968, 41860,770), stdev = 23,739
CI (99.9%): [41750,559, 41933,378] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench05a_Event2
# Run progress: 58,33% complete, ETA 00:05:51
# Fork: 1 of 1
# Warmup Iteration 1: 232134,740 ops/ms
# Warmup Iteration 2: 232240,546 ops/ms
# Warmup Iteration 3: 244584,363 ops/ms
# Warmup Iteration 4: 244602,472 ops/ms
Iteration 1: 244580,866 ops/ms
Iteration 2: 244607,296 ops/ms
Iteration 3: 244600,286 ops/ms
Iteration 4: 244590,484 ops/ms
Iteration 5: 244439,260 ops/ms
Result "net.md_5.SpeedTest.bench05a_Event2":
244563,638 ±(99.9%) 270,481 ops/ms [Average]
(min, avg, max) = (244439,260, 244563,638, 244607,296), stdev = 70,243
CI (99.9%): [244293,157, 244834,120] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench06_2Event
# Run progress: 66,67% complete, ETA 00:04:41
# Fork: 1 of 1
# Warmup Iteration 1: 58497,561 ops/ms
# Warmup Iteration 2: 40128,589 ops/ms
# Warmup Iteration 3: 40835,345 ops/ms
# Warmup Iteration 4: 40882,449 ops/ms
Iteration 1: 40829,960 ops/ms
Iteration 2: 40838,909 ops/ms
Iteration 3: 40836,680 ops/ms
Iteration 4: 40844,440 ops/ms
Iteration 5: 40822,033 ops/ms
Result "net.md_5.SpeedTest.bench06_2Event":
40834,405 ±(99.9%) 33,291 ops/ms [Average]
(min, avg, max) = (40822,033, 40834,405, 40844,440), stdev = 8,645
CI (99.9%): [40801,114, 40867,695] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench06_Event2
# Run progress: 75,00% complete, ETA 00:03:30
# Fork: 1 of 1
# Warmup Iteration 1: 69130,695 ops/ms
# Warmup Iteration 2: 62008,661 ops/ms
# Warmup Iteration 3: 62188,287 ops/ms
# Warmup Iteration 4: 62195,313 ops/ms
Iteration 1: 62187,843 ops/ms
Iteration 2: 62187,198 ops/ms
Iteration 3: 62181,386 ops/ms
Iteration 4: 62192,435 ops/ms
Iteration 5: 62196,630 ops/ms
Result "net.md_5.SpeedTest.bench06_Event2":
62189,099 ±(99.9%) 22,164 ops/ms [Average]
(min, avg, max) = (62181,386, 62189,099, 62196,630), stdev = 5,756
CI (99.9%): [62166,935, 62211,263] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench06a_New2
# Run progress: 83,33% complete, ETA 00:02:20
# Fork: 1 of 1
# Warmup Iteration 1: 201861,065 ops/ms
# Warmup Iteration 2: 193544,960 ops/ms
# Warmup Iteration 3: 211214,410 ops/ms
# Warmup Iteration 4: 211228,694 ops/ms
Iteration 1: 211229,753 ops/ms
Iteration 2: 211181,272 ops/ms
Iteration 3: 211251,405 ops/ms
Iteration 4: 210978,114 ops/ms
Iteration 5: 211249,858 ops/ms
Result "net.md_5.SpeedTest.bench06a_New2":
211178,080 ±(99.9%) 444,058 ops/ms [Average]
(min, avg, max) = (210978,114, 211178,080, 211251,405), stdev = 115,320
CI (99.9%): [210734,023, 211622,138] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench07_3
# Run progress: 91,67% complete, ETA 00:01:10
# Fork: 1 of 1
# Warmup Iteration 1: 48601,536 ops/ms
# Warmup Iteration 2: 37275,030 ops/ms
# Warmup Iteration 3: 37572,963 ops/ms
# Warmup Iteration 4: 37599,547 ops/ms
Iteration 1: 37604,251 ops/ms
Iteration 2: 37580,470 ops/ms
Iteration 3: 37536,460 ops/ms
Iteration 4: 37557,845 ops/ms
Iteration 5: 37582,169 ops/ms
Result "net.md_5.SpeedTest.bench07_3":
37572,239 ±(99.9%) 99,643 ops/ms [Average]
(min, avg, max) = (37536,460, 37572,239, 37604,251), stdev = 25,877
CI (99.9%): [37472,596, 37671,882] (assumes normal distribution)
# Run complete. Total time: 00:14:04
REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial
experiments, perform baseline and negative tests that provide experimental control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.
Do not assume the numbers tell you what you want them to tell.
Benchmark Mode Cnt Score Error Units
SpeedTest.bench01_Blackhole thrpt 5 42639,522 ± 71,873 ops/ms
SpeedTest.bench02_Event thrpt 5 317972,720 ± 940,454 ops/ms
SpeedTest.bench03_Event2 thrpt 5 41659,581 ± 57,944 ops/ms
SpeedTest.bench03a_Event2 thrpt 5 218640,423 ± 151,935 ops/ms
SpeedTest.bench04_Event2 thrpt 5 41641,909 ± 875,904 ops/ms
SpeedTest.bench04a_Event2 thrpt 5 244316,722 ± 1263,248 ops/ms
SpeedTest.bench05_Event2 thrpt 5 41841,968 ± 91,409 ops/ms
SpeedTest.bench05a_Event2 thrpt 5 244563,638 ± 270,481 ops/ms
SpeedTest.bench06_2Event thrpt 5 40834,405 ± 33,291 ops/ms
SpeedTest.bench06_Event2 thrpt 5 62189,099 ± 22,164 ops/ms
SpeedTest.bench06a_New2 thrpt 5 211178,080 ± 444,058 ops/ms
SpeedTest.bench07_3 thrpt 5 37572,239 ± 99,643 ops/ms
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench01_Blackhole
# Run progress: 0,00% complete, ETA 00:14:00
# Fork: 1 of 1
# Warmup Iteration 1: 89618,169 ops/ms
# Warmup Iteration 2: 84448,334 ops/ms
# Warmup Iteration 3: 87554,820 ops/ms
# Warmup Iteration 4: 87579,247 ops/ms
Iteration 1: 87580,284 ops/ms
Iteration 2: 87564,328 ops/ms
Iteration 3: 87564,507 ops/ms
Iteration 4: 87470,531 ops/ms
Iteration 5: 87572,549 ops/ms
Result "net.md_5.SpeedTest.bench01_Blackhole":
87550,440 ±(99.9%) 173,872 ops/ms [Average]
(min, avg, max) = (87470,531, 87550,440, 87580,284), stdev = 45,154
CI (99.9%): [87376,567, 87724,312] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench02_Event
# Run progress: 8,33% complete, ETA 00:12:53
# Fork: 1 of 1
# Warmup Iteration 1: 331282,018 ops/ms
# Warmup Iteration 2: 331444,554 ops/ms
# Warmup Iteration 3: 375226,793 ops/ms
# Warmup Iteration 4: 374394,457 ops/ms
Iteration 1: 375790,478 ops/ms
Iteration 2: 374923,497 ops/ms
Iteration 3: 376708,743 ops/ms
Iteration 4: 376246,708 ops/ms
Iteration 5: 375824,416 ops/ms
Result "net.md_5.SpeedTest.bench02_Event":
375898,768 ±(99.9%) 2543,707 ops/ms [Average]
(min, avg, max) = (374923,497, 375898,768, 376708,743), stdev = 660,593
CI (99.9%): [373355,061, 378442,475] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench03_Event2
# Run progress: 16,67% complete, ETA 00:11:43
# Fork: 1 of 1
# Warmup Iteration 1: 71778,874 ops/ms
# Warmup Iteration 2: 72981,255 ops/ms
# Warmup Iteration 3: 74661,943 ops/ms
# Warmup Iteration 4: 74697,136 ops/ms
Iteration 1: 74704,679 ops/ms
Iteration 2: 74696,457 ops/ms
Iteration 3: 74703,190 ops/ms
Iteration 4: 74711,902 ops/ms
Iteration 5: 74717,354 ops/ms
Result "net.md_5.SpeedTest.bench03_Event2":
74706,716 ±(99.9%) 31,157 ops/ms [Average]
(min, avg, max) = (74696,457, 74706,716, 74717,354), stdev = 8,091
CI (99.9%): [74675,560, 74737,873] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench03a_Event2
# Run progress: 25,00% complete, ETA 00:10:32
# Fork: 1 of 1
# Warmup Iteration 1: 205957,454 ops/ms
# Warmup Iteration 2: 208557,832 ops/ms
# Warmup Iteration 3: 218767,099 ops/ms
# Warmup Iteration 4: 218758,510 ops/ms
Iteration 1: 218729,821 ops/ms
Iteration 2: 218410,720 ops/ms
Iteration 3: 218723,612 ops/ms
Iteration 4: 218722,501 ops/ms
Iteration 5: 218703,369 ops/ms
Result "net.md_5.SpeedTest.bench03a_Event2":
218658,005 ±(99.9%) 533,663 ops/ms [Average]
(min, avg, max) = (218410,720, 218658,005, 218729,821), stdev = 138,591
CI (99.9%): [218124,342, 219191,668] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench04_Event2
# Run progress: 33,33% complete, ETA 00:09:22
# Fork: 1 of 1
# Warmup Iteration 1: 70166,667 ops/ms
# Warmup Iteration 2: 69818,788 ops/ms
# Warmup Iteration 3: 72759,266 ops/ms
# Warmup Iteration 4: 72754,115 ops/ms
Iteration 1: 72689,184 ops/ms
Iteration 2: 72761,026 ops/ms
Iteration 3: 72753,510 ops/ms
Iteration 4: 72761,288 ops/ms
Iteration 5: 72762,295 ops/ms
Result "net.md_5.SpeedTest.bench04_Event2":
72745,461 ±(99.9%) 121,890 ops/ms [Average]
(min, avg, max) = (72689,184, 72745,461, 72762,295), stdev = 31,654
CI (99.9%): [72623,571, 72867,351] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench04a_Event2
# Run progress: 41,67% complete, ETA 00:08:12
# Fork: 1 of 1
# Warmup Iteration 1: 232197,417 ops/ms
# Warmup Iteration 2: 231934,649 ops/ms
# Warmup Iteration 3: 244578,054 ops/ms
# Warmup Iteration 4: 244607,979 ops/ms
Iteration 1: 244602,320 ops/ms
Iteration 2: 244605,368 ops/ms
Iteration 3: 244608,326 ops/ms
Iteration 4: 244605,524 ops/ms
Iteration 5: 244585,156 ops/ms
Result "net.md_5.SpeedTest.bench04a_Event2":
244601,339 ±(99.9%) 35,782 ops/ms [Average]
(min, avg, max) = (244585,156, 244601,339, 244608,326), stdev = 9,293
CI (99.9%): [244565,557, 244637,121] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench05_Event2
# Run progress: 50,00% complete, ETA 00:07:01
# Fork: 1 of 1
# Warmup Iteration 1: 72687,640 ops/ms
# Warmup Iteration 2: 73632,344 ops/ms
# Warmup Iteration 3: 74577,433 ops/ms
# Warmup Iteration 4: 74576,603 ops/ms
Iteration 1: 74584,019 ops/ms
Iteration 2: 74599,095 ops/ms
Iteration 3: 74570,619 ops/ms
Iteration 4: 74580,966 ops/ms
Iteration 5: 74574,429 ops/ms
Result "net.md_5.SpeedTest.bench05_Event2":
74581,825 ±(99.9%) 42,360 ops/ms [Average]
(min, avg, max) = (74570,619, 74581,825, 74599,095), stdev = 11,001
CI (99.9%): [74539,465, 74624,186] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench05a_Event2
# Run progress: 58,33% complete, ETA 00:05:51
# Fork: 1 of 1
# Warmup Iteration 1: 232135,343 ops/ms
# Warmup Iteration 2: 232189,636 ops/ms
# Warmup Iteration 3: 244587,960 ops/ms
# Warmup Iteration 4: 244595,385 ops/ms
Iteration 1: 244606,697 ops/ms
Iteration 2: 244617,822 ops/ms
Iteration 3: 244614,178 ops/ms
Iteration 4: 244594,597 ops/ms
Iteration 5: 244607,252 ops/ms
Result "net.md_5.SpeedTest.bench05a_Event2":
244608,109 ±(99.9%) 34,251 ops/ms [Average]
(min, avg, max) = (244594,597, 244608,109, 244617,822), stdev = 8,895
CI (99.9%): [244573,858, 244642,360] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench06_2Event
# Run progress: 66,67% complete, ETA 00:04:41
# Fork: 1 of 1
# Warmup Iteration 1: 74908,754 ops/ms
# Warmup Iteration 2: 73041,694 ops/ms
# Warmup Iteration 3: 70080,093 ops/ms
# Warmup Iteration 4: 70076,184 ops/ms
Iteration 1: 70074,451 ops/ms
Iteration 2: 70077,516 ops/ms
Iteration 3: 70067,269 ops/ms
Iteration 4: 70089,462 ops/ms
Iteration 5: 70082,090 ops/ms
Result "net.md_5.SpeedTest.bench06_2Event":
70078,158 ±(99.9%) 31,983 ops/ms [Average]
(min, avg, max) = (70067,269, 70078,158, 70089,462), stdev = 8,306
CI (99.9%): [70046,175, 70110,141] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench06_Event2
# Run progress: 75,00% complete, ETA 00:03:30
# Fork: 1 of 1
# Warmup Iteration 1: 74855,839 ops/ms
# Warmup Iteration 2: 77606,863 ops/ms
# Warmup Iteration 3: 85800,881 ops/ms
# Warmup Iteration 4: 85806,227 ops/ms
Iteration 1: 85858,519 ops/ms
Iteration 2: 85736,716 ops/ms
Iteration 3: 85850,485 ops/ms
Iteration 4: 85852,757 ops/ms
Iteration 5: 85844,437 ops/ms
Result "net.md_5.SpeedTest.bench06_Event2":
85828,583 ±(99.9%) 198,701 ops/ms [Average]
(min, avg, max) = (85736,716, 85828,583, 85858,519), stdev = 51,602
CI (99.9%): [85629,881, 86027,284] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench06a_New2
# Run progress: 83,33% complete, ETA 00:02:20
# Fork: 1 of 1
# Warmup Iteration 1: 201767,288 ops/ms
# Warmup Iteration 2: 193504,612 ops/ms
# Warmup Iteration 3: 211245,042 ops/ms
# Warmup Iteration 4: 211254,688 ops/ms
Iteration 1: 211252,134 ops/ms
Iteration 2: 211109,290 ops/ms
Iteration 3: 211211,067 ops/ms
Iteration 4: 211224,284 ops/ms
Iteration 5: 211182,494 ops/ms
Result "net.md_5.SpeedTest.bench06a_New2":
211195,854 ±(99.9%) 209,842 ops/ms [Average]
(min, avg, max) = (211109,290, 211195,854, 211252,134), stdev = 54,495
CI (99.9%): [210986,012, 211405,696] (assumes normal distribution)
# JMH version: 1.32
# VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9
# VM invoker: C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\bin\java.exe
# VM options: <none>
# Blackhole mode: full + dont-inline hint
# Warmup: 4 iterations, 5 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: net.md_5.SpeedTest.bench07_3
# Run progress: 91,67% complete, ETA 00:01:10
# Fork: 1 of 1
# Warmup Iteration 1: 62244,418 ops/ms
# Warmup Iteration 2: 61381,231 ops/ms
# Warmup Iteration 3: 61775,587 ops/ms
# Warmup Iteration 4: 61862,491 ops/ms
Iteration 1: 61861,613 ops/ms
Iteration 2: 61858,368 ops/ms
Iteration 3: 61856,119 ops/ms
Iteration 4: 61849,145 ops/ms
Iteration 5: 61655,478 ops/ms
Result "net.md_5.SpeedTest.bench07_3":
61816,144 ±(99.9%) 346,296 ops/ms [Average]
(min, avg, max) = (61655,478, 61816,144, 61861,613), stdev = 89,932
CI (99.9%): [61469,848, 62162,440] (assumes normal distribution)
# Run complete. Total time: 00:14:03
REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial
experiments, perform baseline and negative tests that provide experimental control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.
Do not assume the numbers tell you what you want them to tell.
Benchmark Mode Cnt Score Error Units
SpeedTest.bench01_Blackhole thrpt 5 87550,440 ± 173,872 ops/ms
SpeedTest.bench02_Event thrpt 5 375898,768 ± 2543,707 ops/ms
SpeedTest.bench03_Event2 thrpt 5 74706,716 ± 31,157 ops/ms
SpeedTest.bench03a_Event2 thrpt 5 218658,005 ± 533,663 ops/ms
SpeedTest.bench04_Event2 thrpt 5 72745,461 ± 121,890 ops/ms
SpeedTest.bench04a_Event2 thrpt 5 244601,339 ± 35,782 ops/ms
SpeedTest.bench05_Event2 thrpt 5 74581,825 ± 42,360 ops/ms
SpeedTest.bench05a_Event2 thrpt 5 244608,109 ± 34,251 ops/ms
SpeedTest.bench06_2Event thrpt 5 70078,158 ± 31,983 ops/ms
SpeedTest.bench06_Event2 thrpt 5 85828,583 ± 198,701 ops/ms
SpeedTest.bench06a_New2 thrpt 5 211195,854 ± 209,842 ops/ms
SpeedTest.bench07_3 thrpt 5 61816,144 ± 346,296 ops/ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment