Many prefs are read many times over and they never change value, or very rarely. A pref read implies in a string hash lookup so maybe the biggest offenders would provide value to be cached. I'm not planning on landing code in the tree for this, just adding debugging locally and using a custom build for a while to get this data. I've got something barebones working for this
Created attachment 8853522 [details] most-read-prefs.txt Ok, here's a sorted list of the most repeatedly-read prefs in a 5min session on my profile, doing some light browsing. All these prefs always returned the same value and never changed. I think at least some of these would be nice improvements, specially layout.css.devPixelsPerPx and the urlclassifier.* ones since the urlclassifier blocks the network channel (and those are char prefs which implies in string copies). Feel free to file bugs for these as you see fit.
Created attachment 8853527 [details] [diff] [review] log-pref-reads.patch Patch used to log this info
Created attachment 8853531 [details] script.js Script used to parse the data and generate the summaries
Alright, my work here is done! Feel free to file bugs for things that are deemed worth it.
Thank you *so much* for doing this, Felipe!
I went through the list and file some more bugs. The rest don't look they are on the hot path so I will leave them as is.