OpenJDK JMH“得分错误”究竟意味着什么?

时间:2014-07-13 14:09:00

标签: performance benchmarking microbenchmark jmh

我正在使用http://openjdk.java.net/projects/code-tools/jmh/进行基准测试,我得到的结果如下:

Benchmark                         Mode   Samples        Score  Score error    Units
o.a.f.c.j.b.TestClass.test1       avgt         5  2372870,600   210897,743    us/op
o.a.f.c.j.b.TestClass.test2       avgt         5  2079931,850   394727,671    us/op
o.a.f.c.j.b.TestClass.test3       avgt         5    26585,818    21105,739    us/op
o.a.f.c.j.b.TestClass.test4       avgt         5    19113,230     8012,852    us/op
o.a.f.c.j.b.TestClass.test5       avgt         5     2586,413     1949,487    us/op
o.a.f.c.j.b.TestClass.test6       avgt         5     1942,963     1619,967    us/op
o.a.f.c.j.b.TestClass.test7       avgt         5      233,902       73,861    us/op
o.a.f.c.j.b.TestClass.test8       avgt         5      191,970      126,682    us/op

“得分误差”一栏究竟是什么意思以及如何解释它?

1 个答案:

答案 0 :(得分:21)

这是分数的误差范围。在大多数情况下,这是confidence interval的一半。想想看,好像“得分”和“得分错误”之间有“±”符号。事实上,人类可读的日志将显示:

Result: 1.986 ±(99.9%) 0.009 ops/ns [Average]
  Statistics: (min, avg, max) = (1.984, 1.986, 1.990), stdev = 0.002
  Confidence interval (99.9%): [1.977, 1.995]


# Run complete. Total time: 00:00:12

Benchmark                  Mode  Samples   Score  Score error   Units
o.o.j.s.HelloWorld.hello  thrpt        5   1.986        0.009  ops/ns