summaryrefslogtreecommitdiff
path: root/libs/androidfw/LocaleDataLookup.cpp
AgeCommit message (Collapse)Author
2025-03-13Regenerate LocaleDataLookup with CLDR patches Victor Chang
CLDR-17809 https://unicode-org.atlassian.net/browse/CLDR-17809 Calendar interval format pattern typo for locale 'hi' CLDR-14088 https://unicode-org.atlassian.net/browse/CLDR-14088 sr_Latn-RU seems odd as default Russian Serbian CLDR-16821 https://unicode-org.atlassian.net/browse/CLDR-16821 Time zone city names for Australian islands are wrong CLDR-18073 https://unicode-org.atlassian.net/browse/CLDR-18073 Samoan time zone names are inconsistent CLDR-17925 https://unicode-org.atlassian.net/browse/CLDR-17925 Danish: typo in translation of "Inche(es) of mercury" - shortform contains (#) instead of (") Bug: 381908969 Test: CtsIcuTestCases CtsIcu4cTestCases Change-Id: I1ec7385584ab0c0ab13d8c595cf67d4706c57860
2025-02-14Update LocaleDataTables Victor Chang
Due to https://unicode-org.atlassian.net/browse/CLDR-18099 Bug: 381908969 Test: m droid Change-Id: I1f306625e1e178d3a6576bb945b631b5f28b3b58
2025-01-31Add benchmarks for LocaleDataLookup Victor Chang
on aosp_cf_x86_64_phone-userdebug, the benchmark result is libandroidfw_benchmarks#BM_LocaleDataLookupIsLocaleRepresentative: PASSED (0ms) cpu_time_ns: 55.07607273354898 real_time_ns: 55.19976479889459 libandroidfw_benchmarks#BM_LocaleDataLookupLikelyScript: PASSED (0ms) cpu_time_ns: 87.99205759931041 real_time_ns: 88.19010674954154 With the unordered_set and unordered_map, the result is libandroidfw_benchmarks#BM_LocaleDataLookupIsLocaleRepresentative: PASSED (0ms) cpu_time_ns: 113.01179143336402 real_time_ns: 113.3695957412614 libandroidfw_benchmarks#BM_LocaleDataLookupLikelyScript: PASSED (1ms) cpu_time_ns: 109.63471229710265 real_time_ns: 109.91545630537807 With std::binary_search, the result is libandroidfw_benchmarks#BM_LocaleDataLookupIsLocaleRepresentative: PASSED (0ms) cpu_time_ns: 123.82590108826805 real_time_ns: 123.98891085230711 Let's keep the current implementation, and add a TODO about the disk size. Bug: 383096413 Test: atest libandroidfw_benchmarks Change-Id: Iaa5f1ab5ac4dcc6bbdd3c4b66fe129c61d75c1d1
2024-12-31Turn LocaleDataTables into C switch statements Victor Chang
It should save memory from initializing std::unordered_map and _set. The generated code size is large (depending on the exact -O options passed to clang), but they should be in the clean pages, rather than dirty pages. Bug: 349675514 Test: atest libandroidfw_tests Change-Id: If1ff8284f7e3bb208d43e63c93e3294d3755890f
2024-12-31Extract implementation of script and locale matching into LocaleDataLookup.h Victor Chang
It helps adding new unit tests, and fixing correctness and performance bugs later. Bug: 386340812 Test: atest libandroidfw_tests Change-Id: I4d3ee1333637d2cd22d5fdfad730935951feeccb