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

The following examples show how to use org.openjdk.jmh.runner.options.Options. These examples are extracted from open source projects. 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 Project: FHIR   Source File: FHIRBenchmarkRunner.java    License: 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 2
Source Project: presto   Source File: BenchmarkInformationSchema.java    License: 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 Project: sofa-jraft   Source File: AppendEntriesBenchmark.java    License: 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 4
Source Project: presto   Source File: BenchmarkPlanner.java    License: 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 5
Source Project: presto   Source File: BenchmarkSTContains.java    License: 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 6
Source Project: FHIR   Source File: FHIRBenchmarkRunner.java    License: 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 7
Source Project: customized-symspell   Source File: SymSpellSearchBenchMark.java    License: 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 8
Source Project: customized-symspell   Source File: SymSpellIndexBenchMark.java    License: 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 9
Source Project: FHIR   Source File: FHIRBenchmarkRunner.java    License: 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 10
Source Project: YuRPC   Source File: YuRPCServerTest.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 客户端发送请求给服务端
 *
 * @throws Throwable
 */
@Test
public void testMethod() throws Throwable {
    Options opt = new OptionsBuilder()
            .include(getClass().getSimpleName())
            .forks(1)
            .build();
    new Runner(opt).run();
}
 
Example 11
Source Project: presto   Source File: BenchmarkCPUCounters.java    License: 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)
            .threads(getInteger("threads", 1))
            .include(".*" + BenchmarkCPUCounters.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example 12
Source Project: presto   Source File: BenchmarkInequalityJoin.java    License: 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(".*" + BenchmarkInequalityJoin.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example 13
Source Project: mica-jmh   Source File: BeanCopySimpleBenchmark.java    License: MIT License 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
	Options opts = new OptionsBuilder()
		.include(BeanCopySimpleBenchmark.class.getSimpleName())
		.warmupIterations(5)
		.measurementIterations(5)
		.jvmArgs("-server")
		.forks(1)
		.resultFormat(ResultFormatType.TEXT)
		.build();
	new Runner(opts).run();
}
 
Example 14
Source Project: presto   Source File: BenchmarkColumnReaders.java    License: 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(".*" + BenchmarkColumnReaders.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example 15
Source Project: presto   Source File: BenchmarkOrcDecimalReader.java    License: Apache License 2.0 5 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();
    new BenchmarkOrcDecimalReader().readDecimal(data);

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkOrcDecimalReader.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example 16
public static void main(String[] args)
        throws Exception
{
    // assure the benchmarks are valid before running
    BenchmarkData data = new BenchmarkData();
    data.setup();
    new BenchmarkDictionaryBlockGetSizeInBytes().getSizeInBytes(data);

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkDictionaryBlockGetSizeInBytes.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example 17
Source Project: arcusplatform   Source File: PerfTestTokenBucket.java    License: Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
   Options opt = new OptionsBuilder()
      .include(PerfTestTokenBucket.class.getSimpleName())
      .build();

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

    new Runner(opt).run();
}
 
Example 20
Source Project: presto   Source File: BenchmarkGroupedTypedHistogram.java    License: 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(".*" + BenchmarkGroupedTypedHistogram.class.getSimpleName() + ".*")
            .addProfiler(GCProfiler.class)
            .build();

    new Runner(options).run();
}
 
Example 21
Source Project: presto   Source File: BenchmarkArrayAggregation.java    License: Apache License 2.0 5 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();
    new BenchmarkArrayAggregation().arrayAggregation(data);

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .warmupMode(WarmupMode.BULK)
            .include(".*" + BenchmarkArrayAggregation.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example 22
Source Project: metrics   Source File: CompassBenchmark.java    License: Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + CompassBenchmark.class.getSimpleName() + ".*")
            .warmupIterations(3)
            .measurementIterations(5)
            .threads(32)
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
Example 23
Source Project: micronaut-data   Source File: SimpleQuery.java    License: 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(2)
            .measurementIterations(5)
            .forks(1)
            .jvmArgsAppend("-ea")
            .build();

    new Runner(opt).run();
}
 
Example 24
Source Project: mica-jmh   Source File: DateBenchmark.java    License: MIT License 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
	Options opts = new OptionsBuilder()
		.include(DateBenchmark.class.getSimpleName())
		.warmupIterations(5)
		.measurementIterations(5)
		.jvmArgs("-server")
		.forks(1)
		.resultFormat(ResultFormatType.TEXT)
		.build();
	new Runner(opts).run();
}
 
Example 25
Source Project: presto   Source File: BenchmarkWindowOperator.java    License: 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(".*" + BenchmarkWindowOperator.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example 26
Source Project: presto   Source File: BenchmarkTopNOperator.java    License: Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
        throws RunnerException
{
    BenchmarkContext data = new BenchmarkContext();
    data.setup();
    new BenchmarkTopNOperator().topN(data);

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

    new Runner(options).run();
}
 
Example 27
Source Project: arcusplatform   Source File: PerfTestRegex.java    License: Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
   Options opt = new OptionsBuilder()
      .include(PerfTestRegex.class.getSimpleName())
      .build();

   new Runner(opt).run();
}
 
Example 28
Source Project: presto   Source File: BenchmarkRegexpFunctions.java    License: 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(".*" + BenchmarkRegexpFunctions.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}
 
Example 29
Source Project: presto   Source File: BenchmarkMapConcat.java    License: Apache License 2.0 5 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();
    new BenchmarkMapConcat().mapConcat(data);

    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .warmupMode(WarmupMode.INDI)
            .include(".*" + BenchmarkMapConcat.class.getSimpleName() + ".*")
            .build();
    new Runner(options).run();
}
 
Example 30
Source Project: presto   Source File: BenchmarkStringFunctions.java    License: 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(".*" + BenchmarkStringFunctions.class.getSimpleName() + ".*")
            .build();

    new Runner(options).run();
}