summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Yurii Zubrytskyi <zyy@google.com> 2024-06-13 17:51:17 -0700
committer Yurii Zubrytskyi <zyy@google.com> 2024-06-13 17:51:17 -0700
commit85e49ba0c47322c44ba2230c95bed97d60408a75 (patch)
tree058bef44ed55436272eec5802d6522319658baf1 /libs/androidfw/StringPool.cpp
parent8fb681e6c4874d08cc4053fc8749e4586441f4fe (diff)
[res] Optimize locale comparison and alias search
1. Locale comparison doesn't need to happen if the locales aren't set at all, and an early check skips the function call overhead 2. Staging resource aliases only exist for Framework resources, and are constrained to a pretty short range. Given that the binary search in STL doesn't check for the value to be inside the array, most of the alias searches end up hitting the worst case with the full log2(n) of halvings before they fail to find it. An early check speeds up the resource lookups by a whopping 10-15%. Bug: 345562237 Test: build, boot, atest + performance tests Change-Id: Ifd2c12c74df4b21a81609102291e6aabe38c2670
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions