Closed Bug 1828316 Opened 2 years ago Closed 2 years ago

Material design page is 4x-5x slower to load in Nightly compared to Chrome

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: mayankleoboy1, Assigned: emilio)

References

()

Details

Attachments

(3 files)

Go to https://m3.material.io/theme-builder#/dynamic
The page will take some time to load. Bear with it.
Click on the button on the top of the page that says "Custom"

Nightly(sequential styling) : https://share.firefox.dev/41dtzBJ (wall clock time is ~8 seconds)
Chrome: Wall clock time is ~2 seconds.

WE should be faster, if possible.

Hi Emilio. Wonder what you think about this page :)

Flags: needinfo?(emilio)

Ugh, so this page is doing something really dumb (building a style rule with hundreds of custom properties one custom property at a time), and due to how we store custom properties we're slower.

So there's something to optimize here (avoid the O(n^2) during custom property parsing), but the page is doing something very silly regardless.

Assignee: nobody → emilio
Flags: needinfo?(emilio)

The test-case included goes from 10s to a couple hundred milliseconds on
my machine. No behavior change other than that.

The test-case goes from 10s to a couple hundred milliseconds on my
machine.

Depends on D175612

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cbfd0c11b248 Avoid linear search to check for custom property presence. r=firefox-style-system-reviewers,zrhoffman
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch

This is the profile from latest Nightly: https://share.firefox.dev/3LbhpU8
Nightly takes ~7 seconds for "Custom" and 2 seconds for "Dynamic". This (switching to "custom") is still slower compared to Chrome, but I dont know if its worth spending more time on this bug.

On the testcase, we are comparable to Chrome now (2 seconds)

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cb6ec53f2169 Add a perf test. r=perftest-reviewers,AlexandruIonescu
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: