diff options
| author | 2024-08-14 14:07:15 +0000 | |
|---|---|---|
| committer | 2024-08-14 14:07:15 +0000 | |
| commit | bf49ff4a99693297bc8c9746867c4cc1ba2ffcd0 (patch) | |
| tree | 559c66a76364786af6cacda67bd15cd746601760 | |
| parent | fda1f4323268706a0d9e11fc96ca237f0bce84c7 (diff) | |
| parent | 67f73eb2aa109d3e9dc8e583777771f9e0a2082f (diff) | |
Merge "Migrate SystemArrayCopyPerfTest to BenchmarkRule" into main am: c098edefe1 am: 67f73eb2aa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3217020
Change-Id: Ib4470244680104057edfa1f112f33ee129b8ae1b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java b/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java index 6363e9c3ef21..25e4c4341b43 100644 --- a/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java @@ -16,7 +16,8 @@ package android.libcore; -import android.perftests.utils.BenchmarkState; +import androidx.benchmark.BenchmarkState; +import androidx.benchmark.junit4.BenchmarkRule; import android.perftests.utils.PerfStatusReporter; import androidx.test.filters.LargeTest; @@ -34,7 +35,8 @@ import java.util.Collection; @RunWith(JUnitParamsRunner.class) @LargeTest public class SystemArrayCopyPerfTest { - @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter(); + @Rule + public BenchmarkRule mBenchmarkRule = new BenchmarkRule(); public static Collection<Object[]> getData() { return Arrays.asList( @@ -51,7 +53,7 @@ public class SystemArrayCopyPerfTest { final int len = arrayLength; char[] src = new char[len]; char[] dst = new char[len]; - BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + final BenchmarkState state = mBenchmarkRule.getState(); while (state.keepRunning()) { System.arraycopy(src, 0, dst, 0, len); } @@ -63,7 +65,7 @@ public class SystemArrayCopyPerfTest { final int len = arrayLength; byte[] src = new byte[len]; byte[] dst = new byte[len]; - BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + final BenchmarkState state = mBenchmarkRule.getState(); while (state.keepRunning()) { System.arraycopy(src, 0, dst, 0, len); } @@ -75,7 +77,7 @@ public class SystemArrayCopyPerfTest { final int len = arrayLength; short[] src = new short[len]; short[] dst = new short[len]; - BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + final BenchmarkState state = mBenchmarkRule.getState(); while (state.keepRunning()) { System.arraycopy(src, 0, dst, 0, len); } @@ -87,7 +89,7 @@ public class SystemArrayCopyPerfTest { final int len = arrayLength; int[] src = new int[len]; int[] dst = new int[len]; - BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + final BenchmarkState state = mBenchmarkRule.getState(); while (state.keepRunning()) { System.arraycopy(src, 0, dst, 0, len); } @@ -99,7 +101,7 @@ public class SystemArrayCopyPerfTest { final int len = arrayLength; long[] src = new long[len]; long[] dst = new long[len]; - BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + final BenchmarkState state = mBenchmarkRule.getState(); while (state.keepRunning()) { System.arraycopy(src, 0, dst, 0, len); } @@ -111,7 +113,7 @@ public class SystemArrayCopyPerfTest { final int len = arrayLength; float[] src = new float[len]; float[] dst = new float[len]; - BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + final BenchmarkState state = mBenchmarkRule.getState(); while (state.keepRunning()) { System.arraycopy(src, 0, dst, 0, len); } @@ -123,7 +125,7 @@ public class SystemArrayCopyPerfTest { final int len = arrayLength; double[] src = new double[len]; double[] dst = new double[len]; - BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + final BenchmarkState state = mBenchmarkRule.getState(); while (state.keepRunning()) { System.arraycopy(src, 0, dst, 0, len); } @@ -135,7 +137,7 @@ public class SystemArrayCopyPerfTest { final int len = arrayLength; boolean[] src = new boolean[len]; boolean[] dst = new boolean[len]; - BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + final BenchmarkState state = mBenchmarkRule.getState(); while (state.keepRunning()) { System.arraycopy(src, 0, dst, 0, len); } |