Pausing benchmarks

Aleksey Shipilev aleksey.shipilev at oracle.com
Fri Aug 21 14:08:53 UTC 2015


Hi Chris,

On 08/21/2015 02:49 PM, Chris Vest wrote:
> I’m wondering if it’s possible to pause a benchmark, without badly
> influencing the measurements, by sending the -STOP signal to the
> parent JMH process (assuming -f >= 1), and then wait for the
> iteration or the fork to finish.

That's technically doable, but tedious, and introduces the complexity
that does not pay back for an overwhelming number of cases. There are
already options available for your corner case:
 a) Chop the work into smaller pieces, and (re-)run benchmark after
benchmark manually;
 b) Make up the API runner that checks for the "pause" condition, before
starting the next benchmark;
 c) Check for "pause" condition in @TearDown(Level.Trial), and stall
there if needed.

All these require additional work from you, but that is expected once
you deviate to corner use cases.

Thanks,
-Alekse



More information about the jmh-dev mailing list