1 package org.openjdk.bench.vm.gc.barriers.writes;
2
3 import org.openjdk.jmh.annotations.*;
4
5 import java.util.concurrent.TimeUnit;
6
7 @Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS)
8 @Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS)
9 @Fork(3)
10 @BenchmarkMode(Mode.AverageTime)
11 @OutputTimeUnit(TimeUnit.NANOSECONDS)
12 @Threads(1)
13 @State(Scope.Thread)
14 public class MultipleZeroes {
15
16 Target dst;
17
18 @Setup
19 public void setup() {
20 dst = new Target();
21 }
22
23 @Benchmark
24 @CompilerControl(CompilerControl.Mode.DONT_INLINE)
25 public void test() {
26 dst.x1 = 0;
27 dst.x2 = 0;
28 dst.x3 = 0;
29 dst.x4 = 0;
30 }
31
32 static class Target {
33 int x1;
34 int x2;
35 int x3;
36 int x4;
37 }
38
39 }