Closed Bug 1917511 Opened 11 months ago Closed 11 months ago

Demo takes 3mins to run and spends 2.4mins in nsParentNodeChildContentList::ValidateCache. Chrome runs in 20s

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

VERIFIED FIXED
132 Branch
Tracking Status
firefox132 --- verified
firefox133 --- verified

People

(Reporter: mayankleoboy1, Assigned: emilio)

References

()

Details

Attachments

(2 files)

Go to https://highlight.xyz/mint/65758ec0c56a0da366b32ab7

AR: It takes 3 minutes on my machine for the demo to render. Chrome renders in ~20seconds.
Profile: https://share.firefox.dev/4cVkSkp

See Also: → 1854771
Attached file about:support

This could perhaps be improved by making sure there is capacity in the array in ValidateCache but it didn't seem to matter much. :smaug, your good at perf solutions. Do you have an idea?

Flags: needinfo?(smaug)

We don't need to update the cache to get the child count...

    function removeChildNodes() {
      _pathCount = 0;

      while (_svg.childNodes.length > 0) {
        _svg.removeChild(_svg.childNodes[0]);
      }
    }

Child count is constant so we don't need the cache. Add a fast path for
uncached first / last node.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(smaug)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8312c5570b7e Improve performance of childNodes. r=smaug

Profile with the autoland build now takes 15 seconds: https://share.firefox.dev/4glRt5O
So we are now faster than Chrome here. Pretty nice!

Duplicate of this bug: 1854771
See Also: → 1854770
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch

And with hte latest Nightly: https://share.firefox.dev/3zlzpIj (15s with the profiler) - I think this 15s is more accurate and represents the demo running rather than the whole pageload.

Regressions: 1921727
QA Whiteboard: [qa-132b-p2]

Reproducible on a 2024-09-08 Nightly build on Windows 10.
Verified as fixed on Firefox 132.0b7 and Firefox Nightly 133.0a1 on Windows 10, macOS 14, Ubuntu 22.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-132b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: