private <L extends Lexer> void warmupAndRun(Class<L> lexerClass, String source,
Function<? super L, Tokens> lexerToIter,
double multiplier)
{
System.out.printf("[%s]: %d tokens in %d chars%n",
lexerClass.getSimpleName(),
countTokens(lexerClass, source),
source.toCharArray().length);
for (int i = 0; i < WARMUP_REPS; ++i) {
timedRuns(lexerClass, source, "warmup " + i, Math.round(WARMUP * multiplier * globalMultiplier), lexerToIter);
}
System.out.println();
System.out.println("Starting main runs...");
double time = timedRuns(lexerClass, source, "runs", Math.round(RUNS * multiplier * globalMultiplier), lexerToIter);
System.out.println();
System.out.println();
fail(time + " ms per run"); // easy reporting.
}
BenchGramBenchmark.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:antlr-denter
作者:
评论列表
文章目录