Closed
Bug 1453149
Opened 7 years ago
Closed 7 years ago
Consider a unified location for defining cached preferences in C++
Categories
(Core :: Preferences: Backend, enhancement)
Core
Preferences: Backend
Tracking
()
RESOLVED
DUPLICATE
of bug 1448219
People
(Reporter: nika, Unassigned)
Details
In C++, we often have a set of BoolVarCache-s which are stored in a static to make accesses to them in the future faster. This is a very common pattern in files like nsContentUtils.
It might be nice to have a location like Services where we can define a set of preferences which should be cached in static variables for efficient lookup, which could then be fetched by doing something like `PrefCache::sMyPref`.
We may be able to integrate this with the prefs system to avoid having to set up the full caching infrastructure for these values, which could be a potential perf / memory usage win.
Comment 1•7 years ago
|
||
It seems to me what you're asking for was done in bug 1436655, specifically in this commit:
https://hg.mozilla.org/mozilla-central/rev/16ac5bd4e50c
Comment 2•7 years ago
|
||
Looks like so. And I guess pretty much all Add*VarCache should be converted to use that.
Comment 3•7 years ago
|
||
That's the plan.
Comment 4•7 years ago
|
||
Bug 1448219 is the meta-bug for converting them.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•