Closed Bug 481128 Opened 16 years ago Closed 2 years ago

HTML5 is slow to load

Categories

(Core :: Layout, defect, P4)

x86
macOS
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox65 --- affected
firefox66 --- affected
firefox67 --- affected

People

(Reporter: ian, Unassigned)

References

(Depends on 2 open bugs, )

Details

(Keywords: perf)

Attachments

(1 file)

HTML5 is slow to load in Firefox. Specifically, the time to parse and lay out the document is slower than other browsers (Opera and Webkit in particular). TESTCASE http://damowmow.com/playground/bugs/slow/html5/001/?slow-browser There's a tarball: http://damowmow.com/playground/bugs/slow/html5/001/html5-perf-001.tar.gz http://damowmow.com/playground/bugs/slow/html5/001/README You have to run the test case with "?slow-browser" on the end of the URL to disable the scripts, which would detract from the load issue.
Keywords: perf
Fwiw, over here webkit trunk loads in about 5.5 seconds uncached, 3.5 seconds cached. Opera 9.6 is 14s uncached, 11s cached. Firefox trunk is 11s uncached, 7s cached. Working on getting some profiles now.
Lessee. 20% reflowing off reflow events. Another 15% reflowing off paint events via [NSView _drawRect:clip:] calling [ChildView drawRect:]. Another 15% reflowing off paint events via [NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] calling _drawRect:clip: and then as above. That's 50% of pageload right there. Compositor might or might not help with this. nsBidiPresUtils::Resolve takes about 6% of total pageload (so about 1/9 of reflow or so). 3% is restyle processing from painting, with stacks as for reflow above. 2% is actual painting. About 25% of the time is under nsCSSFrameConstructor::ContentAppended. A bunch of that is style resolution (e.g. 15.6% of that 25% is in, not under, SelectorMatches). To be precise, about 13% of total pageload is under ResolveStyleContext. 40% of that is RuleProcessorData construction, the rest FileRules. The remainder of the ContentAppended time is spread over various other parts of frame construction. In other words, typical "big page load" profile. :(
Depends on: compositor, 475721
I'm seeing more like 10% of the time under ContentAppended, and 40% of the time under ViewportFrame::Reflow. Did reflow here get worse somehow? Maybe I should try again with ireflow disabled...
So earlier today I was under the impression that the spec took so long to load that I wasn't able to wait for it to finish... although I think that was actually just under callgrind instrumentation. (Though I'd thought I'd checked uninstrumented too.) In any case, I debugged things a little, suspecting (and seeing, in reflow dumps) an O(N^2) reflow problem, and wrote this patch to fix the case where lines were erroneously (in my opinion) being marked dirty. But I think I was somehow imagining the performance problem being as bad as I thought it was, and I really don't know if this would help much. I'm also not convinced of the correctness of this patch in the presence of incremental reflow, although I think it's probably right.
> and 40% of the time under ViewportFrame::Reflow. Did reflow here get worse > somehow? Note that in comment 3 50% of the time was under reflow.
Current numbers (on a much bigger spec) are 12s cached for Gecko and 10s cached for webkit.
Priority: -- → P3
Priority: P3 → P4
Depends on: 962735
Component: DOM → DOM: Core & HTML
Assignee: bzbarsky → nobody
Severity: normal → S3

This test case is very fast now.

Status: NEW → RESOLVED
Closed: 2 years ago
Component: DOM: Core & HTML → Layout
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: