2
我正在運行jmh benchmark,但每個測試的調用都是以串行方式發生的。我怎樣才能使調用同時運行?jmh:同時運行基準測試
這裏是我的代碼摘要:
@State(Scope.Benchmark)
public class FooBenchmark {
@Param({"123456"})
public int barId;
@Setup
public void setup() {
}
@Benchmark
public void run(Blackhole hole) {
System.out.println("A"); // for proof that it's serial (see below)
...
System.out.println("B"); // for proof that it's serial (see below)
}
}
這將打印A和B.然後永遠不會放棄兩個連續的A或B的。