Do you have any ideas of the cases we should use Add*VarCache?

For example, it's bad if using Get* when:

* every painting
* every mousemove
* every user input except mousemove
* every focus move
* every DOM change
* every page load

etc.

I wonder, if everybody uses Add*VarCache, doesn't it cause another performance problem when a pref is changed?

On 2017/02/22 20: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


--
Masayuki Nakano <masay...@d-toybox.com>
Software Engineer, Mozilla
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to