Revert perf test target time to previous one.

ManualBenchmarkState has different default values for test target time
and warmup time.
Perf test numbers may change depending on target time and warmup time.
This CL reverts them to previous ones so that we can get consistent
numbers.

Bug: 174672300
Test: atest CorePerfTests:android.graphics.perftests.TypefaceSerializationPerfTest
Change-Id: I836ed9ba37b1fb424da152d3b53814b7b5115060
This commit is contained in:
Kohsuke Yatoh
2022-07-20 06:07:28 +00:00
parent 9feb92f945
commit cc3315a297

View File

@@ -42,9 +42,17 @@ public class TypefaceSerializationPerfTest {
private static final String TAG = "TypefaceSerializationPerfTest";
// Those values were taken from android.perftests.utils.BenchmarkState.
// Note: we cannot use TimeUnit.toNanos() because these constants are used in annotation.
private static final long WARMUP_DURATION_NS = 250_000_000; // 250ms
private static final long TARGET_TEST_DURATION_NS = 500_000_000; // 500ms
@Rule
public PerfManualStatusReporter mPerfManualStatusReporter = new PerfManualStatusReporter();
@ManualBenchmarkState.ManualBenchmarkTest(
warmupDurationNs = WARMUP_DURATION_NS,
targetTestDurationNs = TARGET_TEST_DURATION_NS)
@Test
public void testSerializeFontMap() throws Exception {
Map<String, Typeface> systemFontMap = Typeface.getSystemFontMap();
@@ -58,6 +66,9 @@ public class TypefaceSerializationPerfTest {
}
}
@ManualBenchmarkState.ManualBenchmarkTest(
warmupDurationNs = WARMUP_DURATION_NS,
targetTestDurationNs = TARGET_TEST_DURATION_NS)
@Test
public void testSerializeFontMap_memory() throws Exception {
Map<String, Typeface> systemFontMap = Typeface.getSystemFontMap();
@@ -70,6 +81,9 @@ public class TypefaceSerializationPerfTest {
}
}
@ManualBenchmarkState.ManualBenchmarkTest(
warmupDurationNs = WARMUP_DURATION_NS,
targetTestDurationNs = TARGET_TEST_DURATION_NS)
@Test
public void testDeserializeFontMap() throws Exception {
SharedMemory memory = Typeface.serializeFontMap(Typeface.getSystemFontMap());
@@ -86,6 +100,9 @@ public class TypefaceSerializationPerfTest {
}
}
@ManualBenchmarkState.ManualBenchmarkTest(
warmupDurationNs = WARMUP_DURATION_NS,
targetTestDurationNs = TARGET_TEST_DURATION_NS)
@Test
public void testDeserializeFontMap_memory() throws Exception {
SharedMemory memory = Typeface.serializeFontMap(Typeface.getSystemFontMap());
@@ -115,6 +132,9 @@ public class TypefaceSerializationPerfTest {
}
}
@ManualBenchmarkState.ManualBenchmarkTest(
warmupDurationNs = WARMUP_DURATION_NS,
targetTestDurationNs = TARGET_TEST_DURATION_NS)
@Test
public void testSetSystemFontMap() throws Exception {
SharedMemory memory = null;