Iteration/Warmup Timeout (was: Using jmh.shutdownTimeout)
Behrooz Nobakht
nobeh5 at gmail.com
Wed Jul 15 05:42:08 UTC 2015
JMH Control is very useful when having a benchmark in which
the benchmark method has explicit control over the target application's
thread model at runtime. Plus, using Control assumes that the benchmark
method gets
to run at least twice to be able to check the state of Control for a
decision/action.
My current case includes a method like the following:
@Benchmark
public Something doBenchmark() {
MyApp app = new App();
return app.doSomeOperation(parametrsFromJMHParam);
}
in which MyApp fires a whole bunch of threads via ExecutorService API.
Based on the parameter into the app (basically an integer), a computation
is started, however, as the parameter becomes a larger value, the
computation
takes more time. This means that for large parameters, my benchmark method
only gets to run at most once. I do not think I can use Control for this.
So, I tried to use @Timeout and the story began that I needed
to ensure that MyApp shuts down all the runtime threads and so forth.
On Wed, Jul 15, 2015 at 12:10 AM, Vladimir Sitnikov <
sitnikov.vladimir at gmail.com> wrote:
> Behrooz,
>
> Can you please give a hint why JMHSample_18_Control does not suit you?
>
> Vladimir
>
--
-- Behrooz Nobakht
More information about the jmh-dev
mailing list