Optimize default value loading.
Previously, we were loading all aconfig default values into the ArrayMap backing SettingsProvider. This was causing boot regressions. It was likely because this would make any calls to `getAllConfigFlags` much more expensive; this function was looping through all SettingsProvider flags and doing a prefix check, _every time_ it was called. This change loads defaults into buckets keyed by the namespaces of the defaults, in a new in-memory structure. This way, `getAllConfigFlags` needs to just look up the defaults for its namespace, when doing a namespace-level call. This doesn't optimize anything when we get every single flag, but from some investigation, there's never a time this gets invoked in the boot process. Test: atest SettingsStateTest Bug: 318514727 Change-Id: I3915ae589de01a09cd959c8b79859f7e4ce65285
Loading
Please register or sign in to comment