diff options
author | Pete Gillin <peteg@google.com> | 2018-04-23 08:34:45 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-04-23 08:34:45 -0700 |
commit | 4979c152b9d3abffda4d94f61e27e5db4476a805 (patch) | |
tree | 4d3dd94906d84572e7a2157410947a8445d60a91 /benchmarks | |
parent | b04d792414fa7228f6844d2496f681bccb886ae3 (diff) | |
parent | 80ac91a113079bc4b6784cf4b6449230c85490ea (diff) |
Merge "Fix DeepArrayOpsBenchmark." am: 1dd66948a4
am: 80ac91a113
Change-Id: Ide22e6d55ec1f7b4694a04077021c8d00060a497
Diffstat (limited to 'benchmarks')
-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); } |