StaticPresData::GetFontPrefsForLang spends time in ICU during Fenix startup
Categories
(Core :: Graphics: Text, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox148 | --- | fixed |
People
(Reporter: mstange, Assigned: mstange, NeedInfo)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Attachments
(1 file)
Profile: https://share.firefox.dev/4rOkjS5
StaticPresData::GetFontPrefsForLang spends time in uloc_addLikelySubtags_78 to figure out that we need to read the prefs ending in .x-western for geckoview.xhtml.
That document doesn't have a language set on it - will it always use en-US? Can we add a fast path to map en-US to x-western so that we don't have to engage ICU here?
| Assignee | ||
Comment 1•9 months ago
|
||
Also, the font prefs don't really matter for this document anyway because it's just a <window> with a <browser> in it and no actual text in the parent process.
| Assignee | ||
Comment 2•9 months ago
|
||
During startup, when geckoview.xhtml's style is initialized, we call
GetLanguageGroup("en-US") to determine font preferences. This currently
triggers expensive ICU likely subtags data loading.
Add a fast path that directly maps "en" and "en-*" to x_western without
calling AddLikelySubtags(), since all English variants use Latin script.
This defers ICU initialization until it's actually needed for non-English
languages, improving startup performance.
Updated•9 months ago
|
| Assignee | ||
Comment 3•9 months ago
•
|
||
Before: https://share.firefox.dev/3XOt9Sj (34 samples in nsPresContext::FlushPendingMediaFeatureValuesChanged)
After: https://share.firefox.dev/3KWh8Y0 (0 samples in nsPresContext::FlushPendingMediaFeatureValuesChanged)
(After + bug 2004948: https://share.firefox.dev/3XOkX4r )
Comment 5•9 months ago
|
||
| bugherder | ||
Comment 6•9 months ago
|
||
Pretty large AWFY wins on Windows.
5.3%/440KB on Base content Explicit
3.8%/436KB on Base Content Redident Unique.
Comment 7•9 months ago
|
||
(In reply to Pulsebot from comment #4)
Pushed by mstange@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/7af4ff603851
https://hg.mozilla.org/integration/autoland/rev/f439d65a5473
Add fast path for English in GetUncachedLanguageGroup to avoid ICU
initialization. r=jfkthame
Perfherder has detected a awsy performance change from push f439d65a5473dd295c79803225fd2ee1ea19a909.
No action is required from the author; this comment is provided for informational purposes only.
Improvements:
| Ratio | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|
| 5% | Base Content Explicit | windows11-64-24h2-shippable | fission | 8,230,420.67 -> 7,798,659.33 |
| 4% | Base Content Resident Unique Memory | windows11-64-24h2-shippable | fission | 11,391,317.33 -> 10,958,506.67 |
Need Help or Information?
If you have any questions, please reach out to bacasandrei@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
Updated•8 months ago
|
Description
•