1 package org.openjdk.bench.vm.gc.barriers.clone;
2
3 import org.openjdk.jmh.annotations.*;
4
5 import java.util.concurrent.TimeUnit;
6
7 @Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS)
8 @Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS)
9 @Fork(value = 3, jvmArgs = {"-Xmx1g", "-Xms1g"})
10 @BenchmarkMode(Mode.AverageTime)
11 @OutputTimeUnit(TimeUnit.NANOSECONDS)
12 @State(Scope.Thread)
13 public class IntArray {
14
15 int[] src;
16
17 @Param({"1", "4", "16", "64", "256", "1024"})
18 int size;
19
20 @Setup
21 public void setup() {
22 src = new int[size];
23 }
24
25 @Benchmark
26 @CompilerControl(CompilerControl.Mode.DONT_INLINE)
27 public Object ints() {
28 return src.clone();
29 }
30
31 }