Loading apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java +22 −0 Original line number Diff line number Diff line Loading @@ -75,8 +75,19 @@ public class ExpensiveObjectsPerfTest { @Test(timeout = 900000) public void timeNewCollator() { BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); int i = 0; while (state.keepRunning()) { Collator.getInstance(Locale.US); if (++i % 1000 == 0) { state.pauseTiming(); // GC and finalize occasionally to avoid GC for alloc and/or // blocking on finalization during benchmark time. // See: b/394961590 System.gc(); System.runFinalization(); state.resumeTiming(); } } } Loading @@ -84,8 +95,19 @@ public class ExpensiveObjectsPerfTest { public void timeClonedCollator() { Collator c = Collator.getInstance(Locale.US); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); int i = 0; while (state.keepRunning()) { c.clone(); if (++i % 1000 == 0) { state.pauseTiming(); // GC and finalize occasionally to avoid GC for alloc and/or // blocking on finalization during benchmark time. // See: b/394961590 System.gc(); System.runFinalization(); state.resumeTiming(); } } } Loading Loading
apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java +22 −0 Original line number Diff line number Diff line Loading @@ -75,8 +75,19 @@ public class ExpensiveObjectsPerfTest { @Test(timeout = 900000) public void timeNewCollator() { BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); int i = 0; while (state.keepRunning()) { Collator.getInstance(Locale.US); if (++i % 1000 == 0) { state.pauseTiming(); // GC and finalize occasionally to avoid GC for alloc and/or // blocking on finalization during benchmark time. // See: b/394961590 System.gc(); System.runFinalization(); state.resumeTiming(); } } } Loading @@ -84,8 +95,19 @@ public class ExpensiveObjectsPerfTest { public void timeClonedCollator() { Collator c = Collator.getInstance(Locale.US); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); int i = 0; while (state.keepRunning()) { c.clone(); if (++i % 1000 == 0) { state.pauseTiming(); // GC and finalize occasionally to avoid GC for alloc and/or // blocking on finalization during benchmark time. // See: b/394961590 System.gc(); System.runFinalization(); state.resumeTiming(); } } } Loading