Closed Bug 1453149 Opened 2 years ago Closed 2 years ago

Consider a unified location for defining cached preferences in C++

Categories

(Core :: Preferences: Backend, enhancement)

enhancement
Not set

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.
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
Looks like so. And I guess pretty much all Add*VarCache should be converted to use that.
That's the plan.
Bug 1448219 is the meta-bug for converting them.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1448219
You need to log in before you can comment on or make changes to this bug.