Closed Bug 1962846 Opened 1 year ago Closed 9 months ago

Testcase inserting N @import stylesheets is 2x slower for N=100K and 20x slower for N=500K in Firefox compared to Chrome.

Categories

(Core :: CSS Parsing and Computation, task)

task

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Open testcase

N=100000
Nightly: https://share.firefox.dev/42NDMH4 (12s)
Chrome: https://share.firefox.dev/42SHHT3 (7s)

Flags: needinfo?(emilio)

N=500000
Firefox: https://share.firefox.dev/4jrm430 (11 minutes to run, 1.45minutes for cleanup)
Chrome: https://share.firefox.dev/4cTanje (34s)

Summary: Testcase inserting N @import stylesheets is 2x slower in Firefox compared to Chrome. → Testcase inserting N @import stylesheets is 2x slower for N=100K and 20x slower for N=500K in Firefox compared to Chrome.

I think that this difference is not really meaningful. What you're seeing is blink wrongly loading the @import sync, so they don't have to do any tree order comparisons or anything in this specific case. If you don't use a data URI, then they get real slow too. E.g.:

        style.textContent = `@import url("https://wpt.live/css/support/b-green.css?${i}");`;
Flags: needinfo?(emilio) → needinfo?(mayankleoboy1)

N=100K
Chrome: https://share.firefox.dev/4lNCowx (3s)
Firefox: https://share.firefox.dev/4iD1rzI (165s for first load, 8m+ for reload)

Flags: needinfo?(mayankleoboy1)

I updated the testcase with your suggested changes and attached in comment 3. The numbers are there too.
ni? for comment 3 if there is anything obvious to improve. Else will close this.

Flags: needinfo?(emilio)

Hmm, that doesn't match my chrome timing if I run that locally. There's some CSP going on in bugzilla tho, which prevents chrome from loading the stylesheet. If I run that on a local server or what not, then it freezes the tab for quite a while. Does that match what you see?

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

Downloaded the second testcase and served to over a local HTTP server.

N=10K
Firefox: https://share.firefox.dev/42KdBAY (1.3s to load, 23s to reload)
Chrome: https://share.firefox.dev/4jr3Bnb

N is smaller here compared to the previous comments. So the time spent by Firefox is lower

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

That's still failing to load the stylesheets somehow in Chrome. If I put 10k, chrome chews CPU for minutes for me (here's a profile, no symbols tho: https://share.firefox.dev/4jtgz3R)

Flags: needinfo?(emilio)

You have symbols like "glStartTilingQCOM" on PID=107706 - are you running this on a ARM64 machine or something? Your profile also show two threads under that process - maybe they are doing software rasterization for whatever reason?

Other than that,I dont have any theory on the difference between the behaviors we see

Blocks: 1980560
See Also: 1943230

The bug is unclear and Emilio cannot repro it.
I will close this. Plenty others exist.

Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: