Huh, that is a horrible bug.

On 02/22/2017 01:42 PM, Gijs Kruitbosch wrote:
Related note: add*varcache uses a pref observer behind the scenes. Pref 
observers always prefix-match, and the *varcache implementation doesn't bother
re-checking whether the pref for which it gets a notification matches the one you 
requested a cache for. So if you have prefs "blah.foo" and
"blah.foo.bar", changing blah.foo.bar will write garbage into your cache for 
blah.foo.

https://bugzilla.mozilla.org/show_bug.cgi?id=1208744

~ Gijs

On 22/02/2017 11:18, smaug wrote:
Hi,

Preferences::GetBool is a slow hashtable lookup and has been showing up
in performance profiles in many places.
Please use Preferences::AddBoolVarCache. Same with other pref types.
Or if the pref needs to be read just once, store the value in some
static variable or so.



-Olli


_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to