diff options
author | 2025-01-31 04:14:03 -0800 | |
---|---|---|
committer | 2025-01-31 04:14:03 -0800 | |
commit | 380340eb8009be6b562497da50e79060cd7d0ca2 (patch) | |
tree | 5d179deb44062e182a7ee09854cf17dbca2f65e7 /libs/androidfw/LocaleDataLookup.cpp | |
parent | 86fc2c7d7679aedb5156fdabde29bbc3abe18542 (diff) | |
parent | 8c1b836852869b3c9ec56d63ead683828a725769 (diff) |
Merge "Add benchmarks for LocaleDataLookup" into main am: 533fa597f9 am: 8c1b836852
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3471369
Change-Id: I46d68a04b213a71d2c5a3b4dd7350a669d0fb17e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs/androidfw/LocaleDataLookup.cpp')
-rw-r--r-- | libs/androidfw/LocaleDataLookup.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/androidfw/LocaleDataLookup.cpp b/libs/androidfw/LocaleDataLookup.cpp index 6e751a77f355..ea9e9a2d4280 100644 --- a/libs/androidfw/LocaleDataLookup.cpp +++ b/libs/androidfw/LocaleDataLookup.cpp @@ -7518,6 +7518,13 @@ const char* lookupLikelyScript(uint32_t packed_lang_region) { } } +/* + * TODO: Consider turning the below switch statement into binary search + * to save the disk space when the table is larger in the future. + * Disassembled code shows that the jump table emitted by clang can be + * 4x larger than the data in disk size, but it depends on the optimization option. + * However, a switch statement will benefit from the future of compiler improvement. + */ bool isLocaleRepresentative(uint32_t language_and_region, const char* script) { const uint64_t packed_locale = ((static_cast<uint64_t>(language_and_region)) << 32u) | |