JMH iterations slow
Aleksey Shipilev
aleksey.shipilev at oracle.com
Thu May 15 11:25:47 UTC 2014
Hi Sebastian,
On 05/15/2014 02:51 PM, Millies, Sebastian wrote:
> Why are the iterations so slow? Looping inside the measurement method
> is actively discouraged, because of JIT optimizations. Are there
> other ways to speed things up?
I am a bit struggling to understand what do you mean by "slow"? By
default, the measurement iterations are time-based, and the default run
time for the iteration is 1 second. That helps to properly warm up the
system, level out outliers, and get accurate timings.
> What if I ever want to run a million iterations?
I miss this point completely. With 22 us per @GMB invocation and 10x1
second iterations, you are already doing roughly a million of @GMB calls.
> PS: I’d like a verbosity mode that only gives me the configuration
> info, result and benchmark, but does not log each iteration, i. e.
> something between NORMAL and completely SILENT, again with a view to
> having many iterations.
This seems like a good idea. Do you want to hack it up yourself?
TextReportFormat is what you are looking at.
-Aleksey.
More information about the jmh-dev
mailing list