Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com;
- import org.junit.Ignore;
- import org.junit.Test;
- import org.openjdk.jmh.annotations.Benchmark;
- import org.openjdk.jmh.annotations.Scope;
- import org.openjdk.jmh.annotations.Setup;
- import org.openjdk.jmh.annotations.State;
- import org.openjdk.jmh.infra.Blackhole;
- import org.openjdk.jmh.profile.GCProfiler;
- import org.openjdk.jmh.runner.Runner;
- import org.openjdk.jmh.runner.options.Options;
- import org.openjdk.jmh.runner.options.OptionsBuilder;
- @State(Scope.Benchmark)
- @Ignore("Benchmark")
- public class Benchmark {
- private AeroRecordToCookieProfileRecord sut;
- @Test
- public void run() throws Exception {
- Options opt = new OptionsBuilder()
- .include(this.getClass().getName() + ".*")
- .warmupIterations(3)
- .measurementIterations(10)
- .threads(1)
- .forks(1)
- .shouldFailOnError(true)
- .shouldDoGC(true)
- //.jvmArgs("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining")
- .addProfiler(GCProfiler.class)
- .build();
- new Runner(opt).run();
- }
- @Setup
- public void setup() throws Exception {
- this.sut = ;
- }
- @Benchmark
- public void test(Blackhole bh) {
- bh.consume(sut.apply());
- }
- }
Add Comment
Please, Sign In to add comment