I'm reading about benchmarking with JMH and now considering the example of asymmetric.
They only said this:
So far all the tests were symmetric: the same code was executed in all the threads. At times, you need the asymmetric test.
At which exactly "times" I need such symmetric benchmarking. I don't understand any practical use case of that facility. They provide the following one:
private AtomicInteger counter;
@Setup
public void up() {
counter = new AtomicInteger();
}
@Benchmark
@Group("g")
@GroupThreads(3)
public int inc() {
return counter.incrementAndGet();
}
@Benchmark
@Group("g")
@GroupThreads(1)
public int get() {
return counter.get();
}
But can you give me some real world use-case of that? I mean, what sort of things may I want to measure asymmetrically?