What's the connection between these prefs?

62 views
Skip to first unread message

Geoff Lankow

unread,
Nov 24, 2021, 2:45:17 AM11/24/21
to dev-pl...@mozilla.org
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

Jonathan Kew

unread,
Nov 24, 2021, 4:56:28 AM11/24/21
to dev-pl...@mozilla.org
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

Geoff Lankow

unread,
Nov 24, 2021, 4:46:09 PM11/24/21
to dev-pl...@mozilla.org
Nope, this is the tip of both mozilla-central and comm-central. But you've given me something to go on, at least. I'll keep digging. Thanks

GL

Geoff Lankow

unread,
Nov 25, 2021, 8:09:34 PM11/25/21
to dev-pl...@mozilla.org, Geoff Lankow
Okay, found it. 11 years ago some code got added which changed a bunch of font prefs on the first run. We're still doing it. Each change in pref is causing the whole lot to be reloaded.

GL
Reply all
Reply to author
Forward
0 new messages