I have a benchmark with a @Param
controlling the input size, such as:
@State(Scope.Benchmark)
class MyBenchmark {
@Param({"100", "10000", "1000000"})
public int ARRAY_SIZE;
public int[] INPUT;
@Setup
public void setUp() {
INPUT = new int[ARRAY_SIZE];
// ...
}
@Benchmark
public void compute() {
// ...
}
}
When the input is large, compute
doesn't get invoked enough times to trigger compilation during warmup. Since I would like to measure peak performance, I want to ensure the method is invoked enough during warmup to be compiled.
Is there a good way to do this? I could set a higher number of warmup iterations, but this would apply to all input sizes when it's really only necessary for the large ones which don't get compiled.