Long restyle times when scrolling on rustconf.com
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: mstange, Unassigned)
Details
When scrolling https://rustconf.com/, a CSS variable on the root element is updated.
This causes restyles that take around 20ms each: https://share.firefox.dev/3k5QHwS
"Elements traversed: 960"
Comment 1•4 years ago
|
||
Yeah, so variables are inherited so we need to restyle the whole DOM. Bug 1417970 is the only idea I have here, though last time I profiled it didn't seem to help all that much.
The patch should still apply though, I didn't rebase it so long ago I think, so may be worth a try.
Reporter | ||
Comment 2•4 years ago
|
||
As a point of comparison, in Chrome, the corresponding "Recalculate Style" boxes in the profile are around 10ms.
Comment 3•4 years ago
|
||
That is interesting, maybe they have an special case for the root? https://bugs.chromium.org/p/chromium/issues/detail?id=1056209 seems to indicate we're much faster at this generally.
Comment 4•4 years ago
|
||
Do you have any adblocker or such? In my laptop those restyles take about 4ms, and the profile looks quite different: https://share.firefox.dev/311lamZ
Reporter | ||
Comment 5•4 years ago
|
||
Oh, indeed, I do! Nevermind then. In a testing profile without adblocker, I get times around 7-10ms.
Comment 6•4 years ago
|
||
Alright, it seems in that case bug 1417970 should help a bit (we shouldn't go through many of the rules that the ad blocker injects, so should save a few milliseconds).
I'll close this as a dupe of that, and if I get time to profile a page like this the patch and with and without an ad blocker, and determine that it gives us enough wins, we should get that landed.
Description
•