1
2 @Benchmark
3 public Object [[TEST]][[TEST_TYPE]][[OP_NAME]]() {
4 $type$[] as = fa.apply(size);
5 $type$[] bs = fb.apply(size);
6 $type$[] rs = fr.apply(size);
7 boolean[] ms = fm.apply(size);
8
9 for (int i = 0; i < as.length; i++) {
10 $type$ a = as[i];
11 $type$ b = bs[i];
12 if (ms[i % ms.length]) {
13 rs[i] = ($type$)([[TEST_OP]]);
14 } else {
15 rs[i] = a;
16 }
17 }
18 return rs;
19 }
|
1
2 @Benchmark
3 public void [[TEST]][[TEST_TYPE]][[OP_NAME]](Blackhole bh) {
4 $type$[] as = fa.apply(size);
5 $type$[] bs = fb.apply(size);
6 $type$[] rs = fr.apply(size);
7 boolean[] ms = fm.apply(size);
8
9 for (int ic = 0; ic < INVOC_COUNT; ic++) {
10 for (int i = 0; i < as.length; i++) {
11 $type$ a = as[i];
12 $type$ b = bs[i];
13 if (ms[i % ms.length]) {
14 rs[i] = ($type$)([[TEST_OP]]);
15 } else {
16 rs[i] = a;
17 }
18 }
19 }
20 bh.consume(rs);
21 }
|