diff options
author | Tony Mak <tonymak@google.com> | 2017-08-07 15:15:57 +0100 |
---|---|---|
committer | Tony Mak <tonymak@google.com> | 2017-08-09 15:50:57 +0000 |
commit | afcd19c71ee825cae6c918a01177f3602b2c9971 (patch) | |
tree | 822d14f660c05672772b3261d4b1ca9ba85851ab /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | 8ce50255c54ccb25d93263afbd76edec55c00d80 (diff) |
Optimize filterByLanguage by caching locale objects
According to traceview, most of the time spent in filterByLanguage
is calling getLocaleObject to create java.util.Locale objects.
The solution is to cache the object to save the cost. Note that both
mSubtypeLangugageTag and mSubtypeLocale are final, so it is fine to
cache the locale object.
Test: bit FrameworksCoreTests:android.view.inputmethod.InputMethodSubtypeTest
Test: bit FrameworksCoreTests:com.android.internal.inputmethod.LocaleUtilsTest
Test: Try to switch user back and forth, and tap a textview to show IME.
Bug: 37647204
Fix: 37647213
Change-Id: Ib6ff7e97b17fc547c8109af8177f05fc3ea41b08
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions