On 24/11/2021 07:45, Geoff Lankow wrote:
> And why would they be read /way/ more than they should be at start-up
> (in comm/mail/base/test/performance/browser_preferences_usage.js) and
> only on Windows? We're talking >1500 times for most of them, so
> /something/ weird is going on.
>
> * bidi.direction
> * bidi.numeral
> * bidi.texttype
> * browser.display.auto_quality_min_font_size
> * dom.send_after_paint_to_content
> * image.animation_mode
> * layout.scrollbar.side
> * toolkit.scrollbox.verticalScrollDistance
I don't know why Windows would be different from other platforms, but
these look like the prefs that are read by
nsPresContext::GetUserPreferences (see
https://searchfox.org/mozilla-central/rev/aa8c75b83f636948f708986173965c84cae8c25f/layout/base/nsPresContext.cpp#475-525).
So why is GetUserPreferences being called so many times? Its two
callsites appear to be nsPresContext::AttachPresShell and
nsPresContext::PreferenceChanged.
OK, I have a guess: if you're looking at a Gecko version prior to 93,
which doesn't have
https://bugzilla.mozilla.org/show_bug.cgi?id=1722487,
then maybe we're being repeatedly notified of
`font.internaluseonly.changed` pref-changes as fonts get initialized.
JK