Search in sources :

Example 16 with OptionsBuilder

use of org.openjdk.jmh.runner.options.OptionsBuilder in project jersey by jersey.

the class ClientBenchmark method main.

public static void main(final String[] args) throws Exception {
    final Options opt = new OptionsBuilder().include(ClientBenchmark.class.getSimpleName()).build();
    new Runner(opt).run();
}
Also used : Options(org.openjdk.jmh.runner.options.Options) Runner(org.openjdk.jmh.runner.Runner) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder)

Example 17 with OptionsBuilder

use of org.openjdk.jmh.runner.options.OptionsBuilder in project javaslang by javaslang.

the class JmhRunner method run.

private static Array<RunResult> run(int warmupIterations, int measurementIterations, int millis, ForkJvm forkJvm, VerboseMode verboseMode, Assertions assertions, PrintInlining printInlining, Array<String> classNames, Array<String> includeNames) {
    try {
        final ChainedOptionsBuilder builder = new OptionsBuilder().shouldDoGC(true).verbosity(verboseMode).shouldFailOnError(true).mode(Mode.Throughput).timeUnit(TimeUnit.SECONDS).warmupTime(TimeValue.milliseconds(millis)).warmupIterations(warmupIterations).measurementTime(TimeValue.milliseconds(millis)).measurementIterations(measurementIterations).forks(forkJvm.forkCount).jvmArgsAppend("-XX:+UseG1GC", "-Xss100m", "-Xms4g", "-Xmx4g", "-XX:MaxGCPauseMillis=1000", "-XX:+UnlockExperimentalVMOptions", "-XX:G1NewSizePercent=100", "-XX:G1MaxNewSizePercent=100", assertions.vmArg);
        final String includePattern = includeNames.mkString("\\..*?\\b(", "|", ")_");
        classNames.forEach(name -> builder.include(name + includePattern));
        if (printInlining == PrintInlining.ENABLE) {
            builder.jvmArgsAppend("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining");
        /* might help in deciding when the JVM is properly warmed up - or where to optimize the code */
        }
        return Array.ofAll(new Runner(builder.build()).run());
    } catch (RunnerException e) {
        throw new RuntimeException(e);
    }
}
Also used : Runner(org.openjdk.jmh.runner.Runner) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) RunnerException(org.openjdk.jmh.runner.RunnerException) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder)

Example 18 with OptionsBuilder

use of org.openjdk.jmh.runner.options.OptionsBuilder in project pinot by linkedin.

the class BenchmarkFileRead method main.

/*  @Benchmark
  @BenchmarkMode({Mode.SampleTime})
  @OutputTimeUnit(TimeUnit.MILLISECONDS)
  public void readUnpacks() {
    int rows = 25000000;
    int columnSizeInBits = 3;
    boolean isMMap = false;
    boolean hasNulls = false;

    int output[] = new int[rows];
    final int outputBytes = MathUtils.lcm(32, columnSizeInBits) / columnSizeInBits;
    final int inputBytes = MathUtils.lcm(32, columnSizeInBits) / 32;
    int destPos = 0;
    int inPos = 0;
    byteBuffer.rewind();
    int[] input = new int[length / 4];
    byteBuffer.asIntBuffer().get(input);
    for (int i = 0; i < (length / 4) / inputBytes; i++) {
      BitPacking.fastunpack(input, inPos, output, destPos, columnSizeInBits);
      destPos += outputBytes;
      inPos += inputBytes;
    }
  }*/
public static void main(String[] args) throws Exception {
    Options opt = new OptionsBuilder().include(BenchmarkFileRead.class.getSimpleName()).forks(1).build();
    new Runner(opt).run();
}
Also used : Options(org.openjdk.jmh.runner.options.Options) Runner(org.openjdk.jmh.runner.Runner) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder)

Example 19 with OptionsBuilder

use of org.openjdk.jmh.runner.options.OptionsBuilder in project pinot by linkedin.

the class BenchmarkFileWrite method main.

public static void main(String[] args) throws Exception {
    Options opt = new OptionsBuilder().include(BenchmarkFileWrite.class.getSimpleName()).forks(1).build();
    new Runner(opt).run();
}
Also used : Options(org.openjdk.jmh.runner.options.Options) Runner(org.openjdk.jmh.runner.Runner) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder)

Example 20 with OptionsBuilder

use of org.openjdk.jmh.runner.options.OptionsBuilder in project pinot by linkedin.

the class BenchmarkQueryEngine method main.

public static void main(String[] args) throws Exception {
    ChainedOptionsBuilder opt = new OptionsBuilder().include(BenchmarkQueryEngine.class.getSimpleName()).warmupTime(TimeValue.seconds(30)).warmupIterations(4).measurementTime(TimeValue.seconds(30)).measurementIterations(20);
    if (ENABLE_PROFILING) {
        opt = opt.addProfiler(StackProfiler.class, "excludePackages=true;excludePackageNames=sun.,java.net.,io.netty.,org.apache.zookeeper.,org.eclipse.jetty.;lines=5;period=1;top=20");
    }
    new Runner(opt.build()).run();
}
Also used : Runner(org.openjdk.jmh.runner.Runner) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder) StackProfiler(org.openjdk.jmh.profile.StackProfiler)

Aggregations

OptionsBuilder (org.openjdk.jmh.runner.options.OptionsBuilder)73 Runner (org.openjdk.jmh.runner.Runner)71 Options (org.openjdk.jmh.runner.options.Options)68 StackProfiler (org.openjdk.jmh.profile.StackProfiler)7 ChainedOptionsBuilder (org.openjdk.jmh.runner.options.ChainedOptionsBuilder)4 RunResult (org.openjdk.jmh.results.RunResult)3 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Mode (org.openjdk.jmh.annotations.Mode)1 BenchmarkParams (org.openjdk.jmh.infra.BenchmarkParams)1 GCProfiler (org.openjdk.jmh.profile.GCProfiler)1 Result (org.openjdk.jmh.results.Result)1 RunnerException (org.openjdk.jmh.runner.RunnerException)1 Statistics (org.openjdk.jmh.util.Statistics)1