我正在使用 jmh 对一个简单的应用程序进行基准测试(来自 SO question Unexpected Scalability results in java fork-join ),使用 maven 并遵循http://openjdk.java.net/projects/code-tools中建议的命令行方法/jmh/。成功设置和构建基准后,我使用 avgt 模式得到以下基准结果:
C:\Users\username\my-app\test>java -jar target/benchmarks.jar -bm avgt -f 1
# JMH 1.10.1 (released 13 days ago)
# VM invoker: C:\Program Files\Java\jre1.8.0_45\bin\java.exe
# VM options: <none>
# Warmup: 20 iterations, 1 s each
# Measurement: 20 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.sample.MyBenchmark.testMethod
# Run progress: 0,00% complete, ETA 00:00:40
# Fork: 1 of 1
# Warmup Iteration 1: ? 10?? s/op
# Warmup Iteration 2: ? 10?? s/op
# Warmup Iteration 3: ? 10?? s/op
# Warmup Iteration 4: ? 10?? s/op
# Warmup Iteration 5: ? 10?? s/op
# Warmup Iteration 6: ? 10?? s/op
# Warmup Iteration 7: ? 10?? s/op
# Warmup Iteration 8: ? 10?? s/op
# Warmup Iteration 9: ? 10?? s/op
# Warmup Iteration 10: ? 10?? s/op
# Warmup Iteration 11: ? 10?? s/op
# Warmup Iteration 12: ? 10?? s/op
# Warmup Iteration 13: ? 10?? s/op
# Warmup Iteration 14: ? 10?? s/op
# Warmup Iteration 15: ? 10?¹? s/op
# Warmup Iteration 16: ? 10?? s/op
# Warmup Iteration 17: ? 10?¹? s/op
# Warmup Iteration 18: ? 10?? s/op
# Warmup Iteration 19: ? 10?¹? s/op
# Warmup Iteration 20: ? 10?¹? s/op
Iteration 1: ? 10?¹? s/op
Iteration 2: ? 10?¹? s/op
Iteration 3: ? 10?? s/op
Iteration 4: ? 10?¹? s/op
Iteration 5: ? 10?¹? s/op
Iteration 6: ? 10?? s/op
Iteration 7: ? 10?¹? s/op
Iteration 8: ? 10?? s/op
Iteration 9: ? 10?? s/op
Iteration 10: ? 10?¹? s/op
Iteration 11: ? 10?? s/op
Iteration 12: ? 10?? s/op
Iteration 13: ? 10?¹? s/op
Iteration 14: ? 10?? s/op
Iteration 15: ? 10?? s/op
Iteration 16: ? 10?¹? s/op
Iteration 17: ? 10?? s/op
Iteration 18: ? 10?¹? s/op
Iteration 19: ? 10?¹? s/op
Iteration 20: ? 10?¹? s/op
Result "testMethod":
? 10?¹? s/op
# Run complete. Total time: 00:00:40
Benchmark Mode Cnt Score Error Units
MyBenchmark.testMethod avgt 20 ? 10?¹? s/op
我不确定如何解释这个输出,但我很确定出了什么问题......?知道什么或如何调试这个吗?