1
1
package org .bk .ass .path ;
2
2
3
+ import org .openjdk .jmh .annotations .*;
4
+
5
+ import javax .imageio .ImageIO ;
3
6
import java .awt .image .BufferedImage ;
4
7
import java .io .IOException ;
5
8
import java .util .ArrayList ;
6
9
import java .util .List ;
7
10
import java .util .SplittableRandom ;
8
- import javax .imageio .ImageIO ;
9
- import org .openjdk .jmh .annotations .Benchmark ;
10
- import org .openjdk .jmh .annotations .Fork ;
11
- import org .openjdk .jmh .annotations .Measurement ;
12
- import org .openjdk .jmh .annotations .Scope ;
13
- import org .openjdk .jmh .annotations .Setup ;
14
- import org .openjdk .jmh .annotations .State ;
15
11
16
12
@ Measurement (iterations = 3 , time = 5 )
17
13
@ Fork (3 )
@@ -55,7 +51,8 @@ public void setup() throws IOException {
55
51
}
56
52
57
53
@ Benchmark
58
- public List <Result > path100RandomStartToEnd (MyState state ) {
54
+ @ OperationsPerInvocation (100 )
55
+ public List <Result > pathRandomStartToEnd (MyState state ) {
59
56
List <Result > results = new ArrayList <>();
60
57
for (Position [] p : state .positions ) {
61
58
results .add (state .jps .findPath (p [0 ], p [1 ]));
@@ -64,7 +61,8 @@ public List<Result> path100RandomStartToEnd(MyState state) {
64
61
}
65
62
66
63
@ Benchmark
67
- public List <Result > path100RandomStartToEndWithPP (MyState state ) {
64
+ @ OperationsPerInvocation (100 )
65
+ public List <Result > pathRandomStartToEndWithPP (MyState state ) {
68
66
List <Result > results = new ArrayList <>();
69
67
for (Position [] p : state .positions ) {
70
68
results .add (state .PPJps .findPath (p [0 ], p [1 ]));
0 commit comments