當前位置: 首頁>>代碼示例>>Java>>正文


Java Runner.run方法代碼示例

本文整理匯總了Java中org.openjdk.jmh.runner.Runner.run方法的典型用法代碼示例。如果您正苦於以下問題:Java Runner.run方法的具體用法?Java Runner.run怎麽用?Java Runner.run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.openjdk.jmh.runner.Runner的用法示例。


在下文中一共展示了Runner.run方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: launchBenchmark

import org.openjdk.jmh.runner.Runner; //導入方法依賴的package包/類
@Test
public void launchBenchmark() throws Exception {
    Options opt = new OptionsBuilder()
            .include(this.getClass().getName() + ".*")
            .warmupTime(TimeValue.seconds(5))
            .warmupIterations(2)
            .measurementTime(TimeValue.seconds(1))
            .measurementIterations(10)
            .threads(4)
            .forks(2)
            .shouldFailOnError(true)
            .shouldDoGC(true)
            .build();

    Runner runner = new Runner(opt);
    runner.run();
}
 
開發者ID:mikroskeem,項目名稱:Shuriken,代碼行數:18,代碼來源:InvocationBenchmark.java

示例2: main

import org.openjdk.jmh.runner.Runner; //導入方法依賴的package包/類
public static void main(String[] args) throws RunnerException {
    ParsedArgs parsed = CliFactory.parseArguments(ParsedArgs.class, args);
    ChainedOptionsBuilder builder = new OptionsBuilder()
            .include(parsed.include())
            .mode(parsed.mode())
            .measurementTime(TimeValue.seconds(parsed.measurementTime()))
            .warmupIterations(10)
            .measurementIterations(10)
            .forks(1)
            .jvmArgsPrepend("-server", "-XX:-TieredCompilation")
            .shouldFailOnError(true)
            .verbosity(VerboseMode.EXTRA)
            .resultFormat(ResultFormatType.CSV);
    if (parsed.printAssembly()) {
        builder = builder.jvmArgsAppend("-XX:+UnlockDiagnosticVMOptions",
                                        "-XX:CompileCommand=print" + (null == parsed.methodName()
                                                ? "" : ",*" + parsed.methodName()),
                                        "-XX:PrintAssemblyOptions=hsdis-print-bytes",
                                        "-XX:CompileCommand=print");
    }
    if (parsed.doPerfasm()) {
        String os = System.getProperty("os.name");
        if (os.toLowerCase().contains("windows")) {
            builder = builder.addProfiler(WinPerfAsmProfiler.class);
        }
        if (os.toLowerCase().contains("linux")) {
            builder = builder.addProfiler(LinuxPerfAsmProfiler.class);
        }
    }
    if (parsed.printCompilation()) {
        builder = builder.jvmArgsAppend("-XX:+PrintCompilation",
                                        "-XX:+UnlockDiagnosticVMOptions",
                                        "-XX:+PrintInlining");
    }
    if (null != parsed.output()) {
        builder = builder.output(parsed.output());
    }

    Runner runner = new Runner(builder.build());
    runner.list();
    runner.run();
}
 
開發者ID:richardstartin,項目名稱:simdbenchmarks,代碼行數:43,代碼來源:Launcher.java


注:本文中的org.openjdk.jmh.runner.Runner.run方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。