diff options
-rw-r--r-- | benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java b/benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java index 142906211b..624d8234bd 100644 --- a/benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java +++ b/benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java @@ -16,21 +16,20 @@ package benchmarks; +import com.google.caliper.BeforeExperiment; +import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.util.Arrays; public class DeepArrayOpsBenchmark { - @Param({"1", "4", "16", "256", "2048"}) int arrayLength; + @Param({"0001", "0004", "0016", "0256", "2048"}) int arrayLength; private Object[] array; private Object[] array2; - private Object[] array3; - private Object[] array4; - - protected void setUp() throws Exception { + @BeforeExperiment public void setUp() throws Exception { array = new Object[arrayLength * 13]; array2 = new Object[arrayLength * 13]; for (int i = 0; i < arrayLength; i += 13) { @@ -77,13 +76,13 @@ public class DeepArrayOpsBenchmark { } } - public void timeDeepHashCode(int reps) { + @Benchmark public void deepHashCode(int reps) { for (int i = 0; i < reps; ++i) { Arrays.deepHashCode(array); } } - public void timeEquals(int reps) { + @Benchmark public void deepEquals(int reps) { for (int i = 0; i < reps; ++i) { Arrays.deepEquals(array, array2); } |