It is customary for many benchmarks to provide a baseline against which the comparison is done. Instead of pushing users to write their own baseline matchers with the help of Java API, we may need to consider marking some of the @Benchmark methods as baseline, and compute the relative performance difference.
E.g. (sample syntax):
@Benchmark
@Baseline
public void baseline() {
return x*x;
}
@Benchmark
public void test() {
return Math.pow(x, 2);
}
...will run both tests, and provide an additional result that would be the "test"/"baseline" ratio or something like that.
E.g. (sample syntax):
@Benchmark
@Baseline
public void baseline() {
return x*x;
}
@Benchmark
public void test() {
return Math.pow(x, 2);
}
...will run both tests, and provide an additional result that would be the "test"/"baseline" ratio or something like that.