@Benchmark @Threads(1) public void testSingleThreadDirectly() { doSomething(); }
@Benchmark @Threads(16) public void test16ThreadsSingleEntry() { doSomethingWithEntry(); } }
@Benchmark @Threads(8) public void test8ThreadsSingleEntry() { doSomethingWithEntry(); }
@Benchmark @Threads(2) public void test2ThreadsSingleEntry() { doSomethingWithEntry(); }
@Benchmark @Threads(3) public void test3ThreadsSingleEntry() { doSomethingWithEntry(); }
@Benchmark @Threads(4) public void test4ThreadsDirectly() { doSomething(); }
@Benchmark @Threads(16) public void test16ThreadsDirectly() { doSomething(); }
@Benchmark @Threads(1) public void testSingleThreadSingleEntry() { doSomethingWithEntry(); }
@Benchmark @Threads(8) public void test8ThreadsDirectly() { doSomething(); }
@Benchmark @Threads(4) public void test4ThreadsSingleEntry() { doSomethingWithEntry(); }
@Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 20, time = 100, timeUnit = TimeUnit.MILLISECONDS) @Benchmark @Threads(2) public void testSampleHit50() { sampleHit10Checks++; if (MethodTracker.hit(2)) { sampleHit10Sampled++; } }
@Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 20, time = 100, timeUnit = TimeUnit.MILLISECONDS) @Benchmark @Threads(2) public void testSampleHit100() { sampleHit10Checks++; if (MethodTracker.hit(3)) { sampleHit10Sampled++; } }
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Benchmark @Threads(1) public void testOneMethodSingleThread() { mip1.recordEntry("a"); mip1.recordExit("a", 1); }
@Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 2000, timeUnit = TimeUnit.MILLISECONDS) @Threads(2) @Benchmark public void testSendCommandMulti2() { br.send(new OkayCommand()); }
@Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 2000, timeUnit = TimeUnit.MILLISECONDS) @Threads(4) @Benchmark public void testSendCommandMulti4() { br.send(new OkayCommand()); }
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Benchmark @Threads(1) public void testTwoMethods01Thread() { mip2.recordEntry("a"); mip2.recordEntry("b"); mip2.recordExit("b", 10); mip2.recordExit("a", 1); }
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Benchmark @Threads(2) public void testTwoMethods02Threads() { mip2.recordEntry("a"); mip2.recordEntry("b"); mip2.recordExit("b", 10); mip2.recordExit("a", 1); }
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Benchmark @Threads(4) public void testTwoMethods04Threads() { mip2.recordEntry("a"); mip2.recordEntry("b"); mip2.recordExit("b", 10); mip2.recordExit("a", 1); }
@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Benchmark @Threads(16) public void testTwoMethods16Threads() { mip2.recordEntry("a"); mip2.recordEntry("b"); mip2.recordExit("b", 10); mip2.recordExit("a", 1); }
/** * @author <a href="mailto:julien@julienviet.com">Julien Viet</a> */ @Warmup(iterations = 20, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 10, time = 2, timeUnit = TimeUnit.SECONDS) @Threads(1) @BenchmarkMode(Mode.Throughput) @Fork(value = 1, jvmArgs = { "-XX:+UseBiasedLocking", "-XX:BiasedLockingStartupDelay=0", "-XX:+AggressiveOpts", "-Djmh.executor=CUSTOM", "-Djmh.executor.class=io.vertx.core.impl.VertxExecutorService" }) @OutputTimeUnit(TimeUnit.MILLISECONDS) public abstract class BenchmarkBase { }