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

The following examples show how to use org.openjdk.jmh.runner.options.OptionsBuilder. 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: conf4j   Source File: PerformanceBenchmarkTest.java    License: MIT License 6 votes vote down vote up
@Test
public void launchBenchmark() throws Exception {
    Options opt = new OptionsBuilder()
            .include(this.getClass().getName() + ".*")
            .mode(Mode.SampleTime)
            .timeUnit(TimeUnit.MICROSECONDS)
            .warmupIterations(1)
            .warmupTime(TimeValue.seconds(1))
            .measurementIterations(1)
            .measurementTime(TimeValue.seconds(5))
            .threads(2)
            .forks(0)
            .syncIterations(true)
            .shouldFailOnError(true)
            .shouldDoGC(false)
            .jvmArgs("-Xms1G", "-Xmx1G", "-XX:MaxGCPauseMillis=10", "-XX:GCPauseIntervalMillis=100")
            .build();
    new Runner(opt).run();
}
 
Example 2
Source Project: yare   Source File: AbstractPerformanceTest.java    License: MIT License 6 votes vote down vote up
@Test
public void runBenchmarks() throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(this.getClass().getSimpleName())
            .mode(Mode.AverageTime)
            .timeUnit(MILLISECONDS)
            .warmupIterations(2)
            .warmupTime(TimeValue.seconds(2))
            .measurementIterations(10)
            .measurementTime(TimeValue.seconds(2))
            .threads(1)
            .warmupForks(0)
            .forks(1)
            .shouldFailOnError(true)
            .shouldDoGC(true)
            .result("benchmarks/performance-results.csv")
            .resultFormat(ResultFormatType.CSV)
            .jvmArgs("-server", "-Xms2048M", "-Xmx2048M", "-XX:+UseG1GC")
            .build();
    new Runner(opt).run();
}
 
Example 3
Source Project: datakernel   Source File: DkDirectScopebindBenchmark.java    License: Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) throws RunnerException {
	System.out.println("Running benchmark with specialization " + (SPECIALIZE ? "ON" : "OFF"));

	Options opt = new OptionsBuilder()
			.include(DkDirectScopebindBenchmark.class.getSimpleName())
			.forks(2)
			.warmupIterations(3)
			.warmupTime(TimeValue.seconds(1L))
			.measurementIterations(10)
			.measurementTime(TimeValue.seconds(2L))
			.mode(Mode.AverageTime)
			.timeUnit(TimeUnit.NANOSECONDS)
			.build();

	new Runner(opt).run();
}
 
Example 4
Source Project: rpc-benchmark   Source File: Client.java    License: Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
	Client client = new Client();

	for (int i = 0; i < 60; i++) {
		try {
			System.out.println(client.getUser());
			break;
		} catch (Exception e) {
			Thread.sleep(1000);
		}
	}

	client.close();

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

	new Runner(opt).run();
}
 
Example 5
Source Project: questdb   Source File: LogBenchmark.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(LogBenchmark.class.getSimpleName())
            .warmupIterations(5)
            .measurementIterations(5)
            .addProfiler("gc")
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
Example 6
Source Project: metrics   Source File: MeterBenchMark.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(".*" + MeterBenchMark.class.getSimpleName() + ".*")
            .warmupIterations(3)
            .measurementIterations(5)
            .threads(32)
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
Example 7
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(OriginalSymSpellBenchmark.class.getSimpleName())
            .warmupIterations(5)
            .measurementIterations(5)
            .forks(1)
            .build();

    new Runner(opt).run();

}
 
Example 8
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(".*" + MessageBufferBenchmarks_PutPeekTake.class.getSimpleName() + ".*")
            .threads(40)
            .build();

    new Runner(opt).run();
}
 
Example 9
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(GarmadonSerializationRegistryBenchmark.class.getSimpleName())
            .build();

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

    new Runner(options).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
public static void main(String[] args)
		throws RunnerException {
	Options options = new OptionsBuilder()
			.verbosity(VerboseMode.NORMAL)
			.include(".*" + StreamNetworkThroughputBenchmarkExecutor.class.getCanonicalName() + ".*")
			.build();

	new Runner(options).run();
}
 
Example 13
Source Project: netty-4.1.22   Source File: AbstractMicrobenchmarkBase.java    License: Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 14
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 15
Source Project: jmh-playground   Source File: JMHSample_24_Inheritance.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(JMHSample_24_Inheritance.class.getSimpleName())
            .build();

    new Runner(opt).run();
}
 
Example 16
public static void main(String[] args) throws Exception {
	new Runner(
		new OptionsBuilder()
			.include(PooledComponentBenchmark.class.getName() + ".*")
			.param("entityCount", "1024", "4096")
			.build())
	.run();
}
 
Example 17
Source Project: rpc-benchmark   Source File: Client.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(Client.class.getSimpleName())//
			.warmupIterations(3)//
			.warmupTime(TimeValue.seconds(10))//
			.measurementIterations(3)//
			.measurementTime(TimeValue.seconds(10))//
			.threads(CONCURRENCY)//
			.forks(1)//
			.build();

	new Runner(opt).run();
}
 
Example 18
public static void main(String[] args)
        throws RunnerException
{
    Options options = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + BenchmarkScanFilterAndProjectOperator.class.getSimpleName() + ".*")
            .build();

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

    new Runner(options).run();
}
 
Example 20
Source Project: t-digest   Source File: ApproxLogBench.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(ApproxLogBench.class.getSimpleName())
            .warmupIterations(5)
            .measurementIterations(5)
            .forks(1)
            .resultFormat(ResultFormatType.CSV)
            .build();

    new Runner(opt).run();
}
 
Example 21
Source Project: questdb   Source File: ColumnSizeLookup.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(ColumnSizeLookup.class.getSimpleName())
            .warmupIterations(5)
            .measurementIterations(5)
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
Example 22
Source Project: sofa-jraft   Source File: RawKVGetBenchmark.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(RawKVGetBenchmark.class.getSimpleName()) //
        .warmupIterations(1) //
        .warmupTime(TimeValue.seconds(10)) //
        .measurementIterations(3) //
        .measurementTime(TimeValue.seconds(10)) //
        .threads(CONCURRENCY) //
        .forks(1) //
        .build();

    new Runner(opt).run();
}
 
Example 23
Source Project: SpringBootBucket   Source File: SecondBenchmark.java    License: MIT License 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    Options opt = new OptionsBuilder()
            .include(SecondBenchmark.class.getSimpleName())
            .forks(1)
            .warmupIterations(5)
            .measurementIterations(2)
            .build();
    Collection<RunResult> results =  new Runner(opt).run();
    ResultExporter.exportResult("单线程与多线程求和性能", results, "length", "微秒");
}
 
Example 24
Source Project: flink-benchmarks   Source File: ListStateBenchmark.java    License: Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .verbosity(VerboseMode.NORMAL)
            .include(".*" + ListStateBenchmark.class.getCanonicalName() + ".*")
            .build();

    new Runner(opt).run();
}
 
Example 25
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(((Class) SmoothlyDecayingRollingCounterBenchmark.class).getSimpleName())
            .warmupIterations(5)
            .measurementIterations(5)
            .threads(4)
            .forks(1)
            .build();
    try {
        new Runner(opt).run();
    } catch (RunnerException e) {
        throw new RuntimeException(e);
    }
}
 
Example 26
Source Project: SpringBootBucket   Source File: FirstBenchmark.java    License: MIT License 5 votes vote down vote up
public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(FirstBenchmark.class.getSimpleName())
            .forks(1)
            .warmupIterations(5)
            .measurementIterations(5)
            .build();
    new Runner(opt).run();
}
 
Example 27
Source Project: brave   Source File: SparkBenchmarks.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(".*" + SparkBenchmarks.class.getSimpleName() + ".*")
    .build();

  new Runner(opt).run();
}
 
Example 28
Source Project: micrometer   Source File: MeterRegistrationBenchmark.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(MeterRegistrationBenchmark.class.getSimpleName())
            .warmupIterations(2)
            .measurementIterations(5)
            .mode(Mode.SampleTime)
            .timeUnit(TimeUnit.SECONDS)
            .forks(1)
            .build();

    new Runner(opt).run();
}
 
Example 29
Source Project: tutorials   Source File: PrimeNumbersUnitManualTest.java    License: MIT License 5 votes vote down vote up
@Test
public void givenPrimesCalculated_whenUsingPoolsAndOneThread_thenOneThreadSlowest() {
    Options opt = new OptionsBuilder()
      .include(Benchmarker.class.getSimpleName())
      .forks(1)
      .build();

    try {
        new Runner(opt).run();
    } catch (RunnerException e) {
        fail();
    }
}
 
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();
}