org.openjdk.jmh.runner.options.Options Java Examples

The following examples show how to use org.openjdk.jmh.runner.options.Options. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BenchmarkPlanner.java    From presto with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args)
        throws Exception
{
    // assure the benchmarks are valid before running
    BenchmarkData data = new BenchmarkData();
    data.setup();
    try {
        new BenchmarkPlanner().planQueries(data);
    }
    finally {
        data.tearDown();
    }

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .warmupMode(WarmupMode.BULK)
            .include(".*" + BenchmarkPlanner.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #2
Source File: BenchmarkInformationSchema.java    From presto with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args)
        throws Exception
{
    // assure the benchmarks are valid before running
    BenchmarkData data = new BenchmarkData();
    data.setup();
    try {
        new BenchmarkInformationSchema().queryInformationSchema(data);
    }
    finally {
        data.tearDown();
    }

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkInformationSchema.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #3
Source File: FHIRBenchmarkRunner.java    From FHIR with Apache License 2.0 6 votes vote down vote up
/**
     * Run and override the 'exampleName' param with the passed fileName
     */
    public Collection<RunResult> run(String fileName) throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(".*" + benchmarkClass.getSimpleName() + ".*")
                .jvmArgsPrepend("-Xms4g", "-Xmx4g")
                .jvmArgsAppend(properties.toArray(new String[properties.size()]))
                .verbosity(VerboseMode.NORMAL)
                .warmupIterations(1)
                .warmupTime(TimeValue.seconds(10))
                .measurementIterations(2)
                .measurementTime(TimeValue.seconds(10))
                .shouldDoGC(false)
                .forks(1)
//              .mode(Mode.AverageTime)
                .addProfiler(StackProfiler.class)
                .param("exampleName", fileName)
                .build();
        return new Runner(opt).run();
    }
 
Example #4
Source File: FHIRBenchmarkRunner.java    From FHIR with Apache License 2.0 6 votes vote down vote up
/**
     * Run without overriding any parameters
     */
    public Collection<RunResult> run() throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(".*" + benchmarkClass.getSimpleName() + ".*")
                .jvmArgsPrepend("-Xms2g", "-Xmx2g")
                .jvmArgsAppend(properties.toArray(new String[properties.size()]))
                .verbosity(VerboseMode.NORMAL)
                .warmupIterations(1)
                .warmupTime(TimeValue.seconds(10))
                .measurementIterations(2)
                .measurementTime(TimeValue.seconds(10))
                .shouldDoGC(true)
                .forks(2)
                .threads(1)
//              .mode(Mode.AverageTime)
                .addProfiler(StackProfiler.class)
                .build();
        return new Runner(opt).run();
    }
 
Example #5
Source File: SymSpellIndexBenchMark.java    From customized-symspell with MIT License 6 votes vote down vote up
@Test
public void testBenchmarkIndex() throws RunnerException, IOException {
  File file = checkFileAndCreate(SymSpellIndexBenchMark.class.getName());
  Options opt = new OptionsBuilder()
      .include(SymSpellIndexBenchMark.class.getSimpleName())
      .addProfiler(MemoryProfiler.class.getName())
      .resultFormat(ResultFormatType.JSON)
      .result(file.getAbsolutePath())
      .warmupIterations(0)
      .measurementIterations(1)
      .forks(1)
      .build();
  new Runner(opt).run();
  System.out.println("Total Lookup results instance " + totalMatches);

}
 
Example #6
Source File: SymSpellSearchBenchMark.java    From customized-symspell with MIT License 6 votes vote down vote up
@Test
public void testBenchmarkSearch() throws RunnerException, IOException {
  File file = checkFileAndCreate(SymSpellSearchBenchMark.class.getName());
  Options opt = new OptionsBuilder()
      .include(SymSpellSearchBenchMark.class.getSimpleName())
      .addProfiler(MemoryProfiler.class.getName())
      .resultFormat(ResultFormatType.JSON)
      .result(file.getAbsolutePath())
      .warmupIterations(0)
      .measurementIterations(1)
      .forks(1)
      .build();
  new Runner(opt).run();
  System.out.println("Total Lookup results instance " + totalMatches);

}
 
Example #7
Source File: AppendEntriesBenchmark.java    From sofa-jraft with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    final int size = ThreadLocalRandom.current().nextInt(100, 1000);
    System.out.println(sendEntries1(256, size).length);
    System.out.println(sendEntries2(256, size).length);
    System.out.println(sendEntries3(256, size, AdaptiveBufAllocator.DEFAULT.newHandle()).length);
    System.out.println(sendEntries4(256, size).length);

    Options opt = new OptionsBuilder() //
        .include(AppendEntriesBenchmark.class.getSimpleName()) //
        .warmupIterations(1) //
        .warmupTime(TimeValue.seconds(5)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .threads(8) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #8
Source File: FHIRBenchmarkRunner.java    From FHIR with Apache License 2.0 6 votes vote down vote up
/**
 * Run the benchmark with all the examples in BenchmarkUtil.SPEC_EXAMPLE_NAMES
 */
public Collection<RunResult> runAll() throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + benchmarkClass.getSimpleName() + ".*")
            .jvmArgsPrepend("-Xms4g", "-Xmx4g")
            .jvmArgsAppend(properties.toArray(new String[properties.size()]))
            .verbosity(VerboseMode.NORMAL)
            .warmupIterations(1)
            .warmupTime(TimeValue.seconds(10))
            .measurementIterations(1)
            .measurementTime(TimeValue.seconds(10))
            .shouldDoGC(true)
            .forks(1)
            .output("results.txt")
            .mode(Mode.SingleShotTime)
            .param("exampleName", BenchmarkUtil.SPEC_EXAMPLE_NAMES.toArray(new String[0])) // https://stackoverflow.com/a/4042464/161022
            .build();
    return new Runner(opt).run();
}
 
Example #9
Source File: BenchmarkSTContains.java    From presto with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args)
        throws IOException, RunnerException
{
    // assure the benchmarks are valid before running
    BenchmarkData data = new BenchmarkData();
    data.setup();
    BenchmarkSTContains benchmark = new BenchmarkSTContains();
    if (!((Boolean) benchmark.stContainsInnerPoint(data)).booleanValue()) {
        throw new IllegalStateException("ST_Contains for inner point expected to return true, got false.");
    }

    if (((Boolean) benchmark.stContainsOuterPointInEnvelope(data)).booleanValue()) {
        throw new IllegalStateException("ST_Contains for outer point expected to return false, got true.");
    }

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkSTContains.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #10
Source File: BenchmarkHiveFileFormat.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws Exception
{
    Options opt = new OptionsBuilder()
            .include(".*\\." + BenchmarkHiveFileFormat.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, \u03B1 = 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();
}
 
Example #11
Source File: SimpleQuery.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(".*" + SimpleQuery.class.getSimpleName() + ".*")
                .warmupIterations(3)
                .measurementIterations(4)
                .forks(1)
//                .jvmArgs("-agentpath:/Applications/YourKit-Java-Profiler-2018.04.app/Contents/Resources/bin/mac/libyjpagent.jnilib")
                .build();

        new Runner(opt).run();
    }
 
Example #12
Source File: SingleThreadExecutorBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    final Options opt = new OptionsBuilder() //
        .include(SingleThreadExecutorBenchmark.class.getSimpleName()) //
        .warmupIterations(3) //
        .measurementIterations(10) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #13
Source File: BenchmarkGeometrySerde.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkGeometrySerde.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #14
Source File: BeanCopyConvertBenchmark.java    From mica-jmh with MIT License 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
	Options opts = new OptionsBuilder()
		.include(BeanCopyConvertBenchmark.class.getSimpleName())
		.warmupIterations(5)
		.measurementIterations(5)
		.jvmArgs("-server")
		.forks(1)
		.resultFormat(ResultFormatType.TEXT)
		.build();
	new Runner(opts).run();
}
 
Example #15
Source File: BenchmarkComputePosition.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws Exception
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkComputePosition.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example #16
Source File: BenchmarkSortedRangeSet.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkSortedRangeSet.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example #17
Source File: BenchmarkDecimalOperators.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkDecimalOperators.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example #18
Source File: BenchmarkBigIntOperators.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws Exception
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkBigIntOperators.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #19
Source File: BenchmarkBoxedBoolean.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkBoxedBoolean.class.getSimpleName() + ".*")
            .addProfiler("perfasm")
            .build();
    new Runner(options).run();
}
 
Example #20
Source File: BenchmarkPagesIndexPageSorter.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkPagesIndexPageSorter.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example #21
Source File: BenchmarkPagesSort.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkPagesSort.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example #22
Source File: BenchmarkInCodeGenerator.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkInCodeGenerator.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example #23
Source File: BenchmarkPageProcessor.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    new BenchmarkPageProcessor().setup();

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkPageProcessor.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example #24
Source File: DateBenchmarkDate.java    From mica-jmh with MIT License 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
	Options opts = new OptionsBuilder()
		.include(DateBenchmarkDate.class.getSimpleName())
		.warmupIterations(5)
		.measurementIterations(5)
		.jvmArgs("-server")
		.forks(1)
		.resultFormat(ResultFormatType.TEXT)
		.build();
	new Runner(opts).run();
}
 
Example #25
Source File: VarIntsBenchmark.java    From sofa-jraft with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder() //
        .include(VarIntsBenchmark.class.getSimpleName()) //
        .warmupIterations(3) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example #26
Source File: BenchmarkReorderChainedJoins.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkReorderChainedJoins.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example #27
Source File: BenchmarkReorderInterconnectedJoins.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkReorderInterconnectedJoins.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example #28
Source File: SimpleQuery.java    From micronaut-data with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
		Options opt = new OptionsBuilder()
//				.jvmArgs("-agentpath:/Applications/YourKit-Java-Profiler-2019.8.app/Contents/Resources/bin/mac/libyjpagent.dylib")
				.include(".*" + SimpleQuery.class.getSimpleName() + ".*").warmupIterations(2)
				.measurementIterations(5).forks(1).jvmArgsAppend("-ea").build();

		new Runner(opt).run();
	}
 
Example #29
Source File: BenchmarkResourceGroup.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws Exception
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkResourceGroup.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example #30
Source File: BenchmarkEnvelopeIntersection.java    From presto with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkEnvelopeIntersection.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}