File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1212import org .openjdk .jmh .annotations .Scope ;
1313import org .openjdk .jmh .annotations .Setup ;
1414import org .openjdk .jmh .annotations .State ;
15+ import org .openjdk .jmh .annotations .Threads ;
1516import org .openjdk .jmh .annotations .Warmup ;
1617import org .openjdk .jmh .infra .Blackhole ;
1718
@@ -280,15 +281,20 @@ public void setup() {
280281
281282 }
282283
284+ DataLoader ownerDL = DataLoaderFactory .newDataLoader (ownerBatchLoader );
285+ DataLoader petDL = DataLoaderFactory .newDataLoader (petBatchLoader );
286+
287+
283288 }
284289
285290
286291 @ Benchmark
287292 @ BenchmarkMode (Mode .AverageTime )
288293 @ OutputTimeUnit (TimeUnit .NANOSECONDS )
294+ @ Threads (Threads .MAX )
289295 public void loadAndDispatch (MyState myState , Blackhole blackhole ) {
290- DataLoader ownerDL = DataLoaderFactory . newDataLoader ( ownerBatchLoader ) ;
291- DataLoader petDL = DataLoaderFactory . newDataLoader ( petBatchLoader ) ;
296+ DataLoader ownerDL = myState . ownerDL ;
297+ DataLoader petDL = myState . petDL ;
292298
293299 for (Owner owner : owners .values ()) {
294300 ownerDL .load (owner .id );
You can’t perform that action at this time.
0 commit comments