Too much time spent instantiating fonts on WRWorker threads (causes scrolling latency on Facebook)
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: mstange, Assigned: lsalzman)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files)
Profile from scrolling on Facebook: https://share.firefox.dev/37u6r7h
On Facebook, when performing a sequence of fast-scroll, pause, fast-scroll, pause, the scrolling has a high latency (>100ms). Profiling reveals that this latency is because WR frame building is blocking on font rasterization.
The profile above is unfortunately missing symbols for system libraries.
I'm attaching a screenshot from an Instruments profile to make up for it. The breakdown in Instruments is as follows:
- 57%
TBaseFont::GetSymbolicTraits
- 21%
CTFontCreateWithGraphicsFont
called fromcore_text::font::new_from_CGFont_with_variations
- 9%
CTFontCreateWithGraphicsFont
called fromprocess_glyph
directly - 7%
CTFontCopyVariationAxes
- 3%
CTFontDrawGlyphs
- 2%
CTFontGetBoundingRectsForGlyphs
- 1%
CTFontGetAdvancesForGlyphs
It seems that we could get rid of 95% here if we held on to certain font objects for longer.
Comment 1•5 years ago
|
||
Could this be the same probem as with Matrix/Elements when trying to use an Emoji in a message? When clicking the smiley to open the emoji popup it takes more than a second to display the emojis on Apple. Note that the file is around 240MB in size.
Comment 2•5 years ago
|
||
Looks like the issue with Elements doesn't always happen. I will keep an eye and file a new bug if it's not related to that specific behavior.
Reporter | ||
Comment 3•5 years ago
|
||
I see similar slowness when switching between github tabs: https://share.firefox.dev/3qtYLdI
![]() |
||
Updated•5 years ago
|
![]() |
||
Updated•5 years ago
|
![]() |
||
Updated•5 years ago
|
Comment 4•5 years ago
|
||
GetSymbolicTraits is called by is_bitmap_font() for every glyph. We should do it once per font.
Assignee | ||
Comment 5•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 7•5 years ago
|
||
bugherder |
![]() |
||
Updated•5 years ago
|
Description
•