Today all benchmarks will have ops/TimeUnit or TimeUnit/op.
For some benchmarks it would be a nice feature to be able to express the Operation to be more specific to what is actually measured.
An example would be a benchmark working on a byte[] and to better understand the performance of the benchmark the output could be bytes/TimeUnit or TimeUnit/byte, which would be more inline in what the benchmark actually tries to measure.
A suggested approach would to have an annotation allow the user to set the Operation unit.
Something similar to this.
@Benchmark
@OperationUnit(singular = "byte")
@OperationsPerInvocation(64 * 1024)
public void measureBytes() {
random.nextBytes(bytes);
}
@Benchmark
@OperationUnit(singular = "foot", plural = "feet")
@OperationsPerInvocation(64 * 1024)
public void measureDistance() {
random.nextBytes(bytes);
}
For some benchmarks it would be a nice feature to be able to express the Operation to be more specific to what is actually measured.
An example would be a benchmark working on a byte[] and to better understand the performance of the benchmark the output could be bytes/TimeUnit or TimeUnit/byte, which would be more inline in what the benchmark actually tries to measure.
A suggested approach would to have an annotation allow the user to set the Operation unit.
Something similar to this.
@Benchmark
@OperationUnit(singular = "byte")
@OperationsPerInvocation(64 * 1024)
public void measureBytes() {
random.nextBytes(bytes);
}
@Benchmark
@OperationUnit(singular = "foot", plural = "feet")
@OperationsPerInvocation(64 * 1024)
public void measureDistance() {
random.nextBytes(bytes);
}