Search in sources :

Example 21 with OptionsBuilder

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

the class AbstractMicrobenchmarkBase method newOptionsBuilder.

protected ChainedOptionsBuilder newOptionsBuilder() throws Exception {
    String className = getClass().getSimpleName();
    ChainedOptionsBuilder runnerOptions = new OptionsBuilder().include(".*" + className + ".*").jvmArgs(jvmArgs());
    if (getWarmupIterations() > 0) {
        runnerOptions.warmupIterations(getWarmupIterations());
    }
    if (getMeasureIterations() > 0) {
        runnerOptions.measurementIterations(getMeasureIterations());
    }
    if (getReportDir() != null) {
        String filePath = getReportDir() + className + ".json";
        File file = new File(filePath);
        if (file.exists()) {
            file.delete();
        } else {
            file.getParentFile().mkdirs();
            file.createNewFile();
        }
        runnerOptions.resultFormat(ResultFormatType.JSON);
        runnerOptions.result(filePath);
    }
    return runnerOptions;
}
Also used : ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder) File(java.io.File) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder)

Example 22 with OptionsBuilder

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

the class UtilBenchmarks method main.

// Convenience main entry-point
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder().include(".*" + UtilBenchmarks.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 23 with OptionsBuilder

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

the class CodecBenchmarks method main.

// Convenience main entry-point
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder().include(".*" + CodecBenchmarks.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 24 with OptionsBuilder

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

the class SpanBenchmarks method main.

// Convenience main entry-point
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder().include(".*" + SpanBenchmarks.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 25 with OptionsBuilder

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

the class HiveFileFormatBenchmark method main.

public static void main(String[] args) throws Exception {
    Options opt = new OptionsBuilder().include(".*\\." + HiveFileFormatBenchmark.class.getSimpleName() + ".*").jvmArgsAppend("-Xmx4g", "-Xms4g", "-XX:+UseG1GC").build();
    Collection<RunResult> results = new Runner(opt).run();
    for (RunResult result : results) {
        Statistics inputSizeStats = result.getSecondaryResults().get("inputSize").getStatistics();
        Statistics outputSizeStats = result.getSecondaryResults().get("outputSize").getStatistics();
        double compressionRatio = 1.0 * inputSizeStats.getSum() / outputSizeStats.getSum();
        String compression = result.getParams().getParam("compression");
        String fileFormat = result.getParams().getParam("fileFormat");
        String dataSet = result.getParams().getParam("dataSet");
        System.out.printf("  %-10s  %-30s  %-10s  %-25s  %2.2f  %10s ± %11s (%5.2f%%) (N = %d, α = 99.9%%)\n", result.getPrimaryResult().getLabel(), dataSet, compression, fileFormat, compressionRatio, toHumanReadableSpeed((long) inputSizeStats.getMean()), toHumanReadableSpeed((long) inputSizeStats.getMeanErrorAt(0.999)), inputSizeStats.getMeanErrorAt(0.999) * 100 / inputSizeStats.getMean(), inputSizeStats.getN());
    }
    System.out.println();
}
Also used : Options(org.openjdk.jmh.runner.options.Options) Runner(org.openjdk.jmh.runner.Runner) RunResult(org.openjdk.jmh.results.RunResult) Statistics(org.openjdk.jmh.util.Statistics) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder)

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