Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a48795b3 authored by Ted Bauer's avatar Ted Bauer
Browse files

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
parent 4881667c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment