OpenJDK JMH有时会在结果中打印(* interrupt *)。这到底是什么意思?

时间:2014-07-13 23:48:25

标签: performance benchmarking microbenchmark jmh

我使用的是OpenJDK JMH 0.9.3,有时我会得到如下所示的结果日志文件。 这里的意思是什么(*中断*)?

Forking 1 times using command: [/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/...]
# Run progress: 53,85% complete, ETA 00:01:26
# Fork: 1 of 1
# Warmup Iteration   1: 19950765,000 us/op
# Warmup Iteration   2: (*interrupt*) (*interrupt*) (*interrupt*) 18107134,000 us/op
# Warmup Iteration   3: (*interrupt*) 14439157,500 us/op
Iteration   1: 13571806,000 us/op
Iteration   2: 7484946,500 us/op
Iteration   3: (*interrupt*) 12386565,000 us/op
Iteration   4: (*interrupt*) 7245477,500 us/op
Iteration   5: (*interrupt*) 9047236,000 us/op


Result: 9947206,200 ±(99.9%) 11103651,130 us/op [Average]
  Statistics: (min, avg, max) = (7245477,500, 9947206,200, 13571806,000), stdev = 2883582,937
  Confidence interval (99.9%): [-1156444,930, 21050857,330]

1 个答案:

答案 0 :(得分:1)

这意味着您的工作负载被JMH中断,很可能是因为它超出了迭代时间。它打印"(中断)"让你知道得分是通过积极干预JMH获得的,可能是不可靠的。

您可以使用@Timeout(time = 1, timeUnit = TimeUnit.HOURS)注释对您的基准进行注释,它会知道它需要更长时间。默认情况下,当您运行某个批量测量(未设置时间限制)时,它将default to 10 minutes time limit