Search in sources :

Example 46 with OptionsBuilder

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

the class MapJoinOneLongKeyBench method main.

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

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

the class VectorSelectOperatorBench method main.

/*
   * ============================== HOW TO RUN THIS TEST: ====================================
   *
   * You can run this test:
   *
   * a) Via the command line:
   *    $ mvn clean install
   *    $ java -jar target/benchmarks.jar VectorSelectOperatorBench -prof perf     -f 1 (Linux)
   *    $ java -jar target/benchmarks.jar VectorSelectOperatorBench -prof perfnorm -f 3 (Linux)
   *    $ java -jar target/benchmarks.jar VectorSelectOperatorBench -prof perfasm  -f 1 (Linux)
   *    $ java -jar target/benchmarks.jar VectorSelectOperatorBench -prof gc  -f 1 (allocation counting via gc)
   */
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder().include(VectorSelectOperatorBench.class.getSimpleName()).addProfiler(LinuxPerfProfiler.class).addProfiler(LinuxPerfNormProfiler.class).addProfiler(LinuxPerfAsmProfiler.class).build();
    new Runner(opt).run();
}
Also used : Options(org.openjdk.jmh.runner.options.Options) Runner(org.openjdk.jmh.runner.Runner) LinuxPerfProfiler(org.openjdk.jmh.profile.LinuxPerfProfiler) LinuxPerfAsmProfiler(org.openjdk.jmh.profile.LinuxPerfAsmProfiler) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder)

Example 48 with OptionsBuilder

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

the class BenchmarkTest method newOptionsBuilder.

private ChainedOptionsBuilder newOptionsBuilder() throws Exception {
    String className = getClass().getSimpleName();
    ChainedOptionsBuilder runnerOptions = new OptionsBuilder().include(".*" + className + ".*").detectJvmArgs();
    // We have to pass system properties into the child JVM
    // TODO: This should probably not be necessary
    List<String> jvmArgs = new ArrayList<>();
    for (GraknSystemProperty property : GraknSystemProperty.values()) {
        String value = property.value();
        if (value != null) {
            jvmArgs.add("-D" + property.key() + "=" + value);
        }
    }
    runnerOptions.jvmArgsAppend(jvmArgs.toArray(new String[jvmArgs.size()]));
    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) GraknSystemProperty(ai.grakn.GraknSystemProperty) ArrayList(java.util.ArrayList) File(java.io.File) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder) ChainedOptionsBuilder(org.openjdk.jmh.runner.options.ChainedOptionsBuilder)

Example 49 with OptionsBuilder

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

the class JmhIdeBenchmarkRunner method optionsBuilder.

/**
 * Get prepared options builder.
 *
 * @return Options builder.
 */
public OptionsBuilder optionsBuilder() {
    OptionsBuilder builder = new OptionsBuilder();
    builder.forks(forks);
    builder.warmupIterations(warmupIterations);
    builder.measurementIterations(measurementIterations);
    builder.timeUnit(outputTimeUnit);
    builder.threads(threads);
    if (benchmarkModes != null) {
        for (Mode benchmarkMode : benchmarkModes) builder.getBenchModes().add(benchmarkMode);
    }
    if (benchmarks != null) {
        for (Object benchmark : benchmarks) {
            if (benchmark instanceof Class)
                builder.include(((Class) benchmark).getSimpleName());
            else
                builder.include(benchmark.toString());
        }
    }
    if (jvmArgs != null)
        builder.jvmArgs(jvmArgs);
    if (output != null)
        builder.output(output);
    if (profilers != null) {
        for (Class profiler : profilers) builder.addProfiler(profiler);
    }
    return builder;
}
Also used : Mode(org.openjdk.jmh.annotations.Mode) OptionsBuilder(org.openjdk.jmh.runner.options.OptionsBuilder)

Example 50 with OptionsBuilder

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

the class JacksonBenchmark method main.

public static void main(final String[] args) throws Exception {
    final Options opt = new OptionsBuilder().include(JacksonBenchmark.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)

Aggregations

OptionsBuilder (org.openjdk.jmh.runner.options.OptionsBuilder)84 Runner (org.openjdk.jmh.runner.Runner)79 Options (org.openjdk.jmh.runner.options.Options)76 StackProfiler (org.openjdk.jmh.profile.StackProfiler)7 ChainedOptionsBuilder (org.openjdk.jmh.runner.options.ChainedOptionsBuilder)7 File (java.io.File)3 RunResult (org.openjdk.jmh.results.RunResult)3 ArrayList (java.util.ArrayList)2 GCProfiler (org.openjdk.jmh.profile.GCProfiler)2 LinuxPerfAsmProfiler (org.openjdk.jmh.profile.LinuxPerfAsmProfiler)2 LinuxPerfProfiler (org.openjdk.jmh.profile.LinuxPerfProfiler)2 GraknSystemProperty (ai.grakn.GraknSystemProperty)1 CacheAtomicityMode (org.apache.ignite.cache.CacheAtomicityMode)1 CacheWriteSynchronizationMode (org.apache.ignite.cache.CacheWriteSynchronizationMode)1 JmhIdeBenchmarkRunner (org.apache.ignite.internal.benchmarks.jmh.runner.JmhIdeBenchmarkRunner)1 Mode (org.openjdk.jmh.annotations.Mode)1 BenchmarkParams (org.openjdk.jmh.infra.BenchmarkParams)1 Result (org.openjdk.jmh.results.Result)1 RunnerException (org.openjdk.jmh.runner.RunnerException)1 Statistics (org.openjdk.jmh.util.Statistics)1