summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorSeigo Nonaka <nona@google.com>2017-05-15 16:25:11 -0700
committerSeigo Nonaka <nona@google.com>2017-05-16 10:14:56 -0700
commit2ea169a2ecbb7e589fcef78cb1486d007a8fb867 (patch)
treebc9958b4719c1d704157b8179c0751322ff18836 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent9289faa163b2c4ea449cf466cd29dac061647b3e (diff)
Introduce early exit path for non resource path.
Developer can specify android:fontFamily with three ways, pre-defined font family name, e.g. "sans-serif", path to the font file in resource directory, e.g. "res/fonts/Roboto-Regular.ttf", or path to the XML font family file, e.g. "res/fonts/Roboto.xml". Resources.getFont treats font files and XML files but pre-defined family name is handled by TextView. Thus, we can early exit if the passed value is not likely resource path. This improves the inflation performance. The score without this patch: gfx-avg-frame-time-50: 6.9 gfx-avg-frame-time-90: 9.4 gfx-avg-frame-time-95: 10.4 gfx-avg-frame-time-99: 16.7 The score with this patch: gfx-avg-frame-time-50: 7.0 gfx-avg-frame-time-90: 8.9 gfx-avg-frame-time-95: 9.7 gfx-avg-frame-time-99: 16.5 Measured on bullhead-userdebug. The APCT perf test improves from String FontFamily: 200,086 -> 132,561 File FontFamily : 199,256 -> 161,843 XML FontFamily : 203,681 -> 158,553 Measured on angler-userdebug. Bug: 38232467 Test: UiBenchmark Change-Id: Ia601ae7207ae8c60848c9efdbb9396267a57257c
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions