Closed Bug 1866161 Opened 2 years ago Closed 2 years ago

Navigating to specific markdown files on github is extremely slow

Categories

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

defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: mstange, Assigned: emilio)

Details

Attachments

(1 file)

Steps to reproduce:

  1. Go to https://github.com/jrmuizel/github-slow-md
  2. Click on go-slow.md

Expected results:
The contents of the markdown file should appear quickly. (They do in Chrome.)

Actual results:
It takes thirty seconds or more.

Profile: https://share.firefox.dev/3SPoNsN

To add to that: It gets massively worse if you select one of the JS code boxes and try to view the source for the selection. That took several minutes on my machine (on a M1 Mac; loading the md file itself only took ~5s instead of the reported 30s).

I have created a few-second-snapshot profile. That profile shows significant time is spent in this comparator, which calls nsINode::ComparePoints_deprecated(), all triggered from nsIFrame::IsFrameSelected() while reflowing.

It looks from the profile as if nsIFrame::IsFrameSelected() is called twice during reflow. Maybe it's possible to add some caching there (that feels like fighting the symptoms though, and also won't fix the original issue)?

:smaug, wdyt?

Severity: -- → S3
Flags: needinfo?(smaug)

If the element already has the right directionality we don't need to
traverse the whole subtree.

Clean-up surrounding code a little bit while at it.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(smaug)

oh, the needinfo was for another issue. Jan, please file another bug for that.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9951dfb718b3 Stop propagating directionality earlier. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: