Open Bug 1598268 Opened 6 years ago Updated 2 years ago

Parsing CSS takes significant amount of main thread time when loading Youtube

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

People

(Reporter: smaug, Unassigned)

Details

Attachments

(2 files)

https://perfht.ml/2raumXU

Could we possibly parse the style sheet off the main and only after that add the element to DOM or something?

Flags: needinfo?(emilio)

This is the biggest one, the others are fairly minor.

Note that Chrome and WebKit have lazy css parsing, so they seem to parse the sheet faster, though they pay the price of parsing the declarations later, when they get used. Of course in the benchmark they don't get used though.

Severity: normal → S3

I see us on par with Chrome nowadays, can you still repro this? https://share.firefox.dev/3sCQHNt doesn't show much css parsing now.

Flags: needinfo?(emilio) → needinfo?(smaug)

On linux Chrome seems to be still 25% faster in that testcase
But let me profile too

Flags: needinfo?(smaug)

https://share.firefox.dev/3R81cTd looks similar to yours. So we're still taking non-trivial amount main thread time.
And at least on warm page loads we're behind Chrome.
So I think this is still valid.

Too bad the initial profile isn't really available anymore - at least it doesn't show any profile data for me.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: