use of org.openjdk.jmh.runner.options.OptionsBuilder in project jersey by jersey.
the class ClientBenchmark method main.
public static void main(final String[] args) throws Exception {
final Options opt = new OptionsBuilder().include(ClientBenchmark.class.getSimpleName()).build();
new Runner(opt).run();
}
use of org.openjdk.jmh.runner.options.OptionsBuilder in project javaslang by javaslang.
the class JmhRunner method run.
private static Array<RunResult> run(int warmupIterations, int measurementIterations, int millis, ForkJvm forkJvm, VerboseMode verboseMode, Assertions assertions, PrintInlining printInlining, Array<String> classNames, Array<String> includeNames) {
try {
final ChainedOptionsBuilder builder = new OptionsBuilder().shouldDoGC(true).verbosity(verboseMode).shouldFailOnError(true).mode(Mode.Throughput).timeUnit(TimeUnit.SECONDS).warmupTime(TimeValue.milliseconds(millis)).warmupIterations(warmupIterations).measurementTime(TimeValue.milliseconds(millis)).measurementIterations(measurementIterations).forks(forkJvm.forkCount).jvmArgsAppend("-XX:+UseG1GC", "-Xss100m", "-Xms4g", "-Xmx4g", "-XX:MaxGCPauseMillis=1000", "-XX:+UnlockExperimentalVMOptions", "-XX:G1NewSizePercent=100", "-XX:G1MaxNewSizePercent=100", assertions.vmArg);
final String includePattern = includeNames.mkString("\\..*?\\b(", "|", ")_");
classNames.forEach(name -> builder.include(name + includePattern));
if (printInlining == PrintInlining.ENABLE) {
builder.jvmArgsAppend("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining");
/* might help in deciding when the JVM is properly warmed up - or where to optimize the code */
}
return Array.ofAll(new Runner(builder.build()).run());
} catch (RunnerException e) {
throw new RuntimeException(e);
}
}
use of org.openjdk.jmh.runner.options.OptionsBuilder in project kafka by apache.
the class LRUCacheBenchmark method main.
public static void main(String[] args) throws RunnerException {
Options opt = new OptionsBuilder().include(LRUCacheBenchmark.class.getSimpleName()).forks(2).build();
new Runner(opt).run();
}
use of org.openjdk.jmh.runner.options.OptionsBuilder in project useful-java-links by Vedenin.
the class ConvertInputStreamToStringBenchmark method main.
public static void main(String[] args) throws Exception {
ConvertInputStreamToStringBenchmark test = new ConvertInputStreamToStringBenchmark();
System.out.println();
System.out.println("1. apacheToInputStream : " + test.test1_apacheToInputStream().length());
System.out.println("2. guavaCharStreams : " + test.test2_guavaCharStreams().length());
System.out.println("3. jdkScanner : " + test.test3_jdkScanner().length());
System.out.println("4. jdkJava8 : " + test.test4_jdkJava8().length());
System.out.println("5. jdkJava8parallel : " + test.test5_jdkJava8parallel().length());
System.out.println("6. inputStreamReaderAndStringBuilder : " + test.test6_inputStreamReaderAndStringBuilder().length());
System.out.println("7. apacheStringWriterAndIOUtilsCopy : " + test.test7_apacheStringWriterAndIOUtilsCopy().length());
System.out.println("8. readByteArrayOutputStream : " + test.test8_readByteArrayOutputStream().length());
System.out.println("9. bufferedReaderReadLine : " + test.test9_bufferedReaderReadLine().length());
System.out.println("10. bufferedInputStreamAndByteArrayOutputStream : " + test.test10_bufferedInputStreamAndByteArrayOutputStream().length());
System.out.println("11. inputStreamReadAndStringBuilder : " + test.test11_inputStreamReadAndStringBuilder().length());
System.out.println("12. test12_bufferedReaderReadLine2 : " + test.test12_bufferedReaderReadLine2().length());
System.out.println();
Options opt = new OptionsBuilder().include(ConvertInputStreamToStringBenchmark.class.getSimpleName()).build();
new Runner(opt).run();
}
use of org.openjdk.jmh.runner.options.OptionsBuilder in project useful-java-links by Vedenin.
the class ConvertInputStreamToStringBigBenchmark method main.
public static void main(String[] args) throws Exception {
ConvertInputStreamToStringBigBenchmark test = new ConvertInputStreamToStringBigBenchmark();
System.out.println();
System.out.println("1. apacheToInputStream : " + test.apacheToInputStream().length());
System.out.println("2. guavaCharStreams : " + test.guavaCharStreams().length());
System.out.println("3. jdkScanner : " + test.jdkScanner().length());
System.out.println("4. jdkJava8 : " + test.jdkJava8().length());
System.out.println("5. jdkJava8parallel : " + test.jdkJava8parallel().length());
System.out.println("6. inputStreamReaderAndStringBuilder : " + test.inputStreamReaderAndStringBuilder().length());
System.out.println("7. apacheStringWriterAndIOUtilsCopy : " + test.apacheStringWriterAndIOUtilsCopy().length());
System.out.println("8. readByteArrayOutputStream : " + test.readByteArrayOutputStream().length());
System.out.println("9. bufferedReaderReadLine : " + test.bufferedReaderReadLine().length());
System.out.println("10. bufferedInputStreamAndByteArrayOutputStream : " + test.bufferedInputStreamAndByteArrayOutputStream().length());
System.out.println("11. inputStreamReadAndStringBuilder : " + test.inputStreamReadAndStringBuilder().length());
System.out.println("12. test12_bufferedReaderReadLine2 : " + test.test12_bufferedReaderReadLine2().length());
System.out.println();
Options opt = new OptionsBuilder().include(ConvertInputStreamToStringBigBenchmark.class.getSimpleName()).build();
new Runner(opt).run();
}
Aggregations