Skip to content
Commit 23f1be2d authored by Kohsuke Yatoh's avatar Kohsuke Yatoh
Browse files

Preload font before TypefaceSerializationPerfTest.

This CL disables lazy font loading by preloading font in setUp(),
in order to stabilize testSerializeFontMap() results.

In testSerializeFontMap(), the first serializeFontMap() takes 20x time
due to lazy font loading (first call 40ms / avg 2ms on oriole).
This makes test results unstable by reducing the number of iterations.

ManualBenchmarkState calculates the number of iterations
('mMaxIterations') as follows:
    mMaxIterations = (int) (mTargetTestDurationNs / (warmupDuration / iterations));
where 'iterations' is the number of iterations done in warmup stage.
If the first iteration in warmup stage takes unusually long,
'iterations' becomes small and mMaxIterations will be smaller as well.

Bug: 239758440
Test: atest CorePerfTests:android.graphics.perftests.TypefaceSerializationPerfTest#testSerializeFontMap
Change-Id: I3181962a1807cb7b4ecbc8e26fe629b9f530e1c1
parent 29705980
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment