Closed Bug 1656327 Opened 4 years ago Closed 4 years ago

Long restyle times when scrolling on rustconf.com

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1417970

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"

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.

Depends on: 1417970

As a point of comparison, in Chrome, the corresponding "Recalculate Style" boxes in the profile are around 10ms.

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.

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

Oh, indeed, I do! Nevermind then. In a testing profile without adblocker, I get times around 7-10ms.

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.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
No longer depends on: 1417970
You need to log in before you can comment on or make changes to this bug.