Closed
Bug 397510
Opened 18 years ago
Closed 18 years ago
Scrolling in large file is very slow due to textrun reconstruction
Categories
(Core :: Layout: Text and Fonts, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla1.9beta2
People
(Reporter: bzbarsky, Assigned: roc)
Details
(Keywords: perf, regression, Whiteboard: [dbaron-1.9:RzCt])
Attachments
(1 file, 1 obsolete file)
9.17 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
BUILD: Current trunk Linux build
STEPS TO REPRODUCE:
1) Start the browser
2) Load http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1190683140.1190683950.6780.gz&fulltext=1
3) Scroll to the bottom (e.g. by hitting the end key)
4) Wait 30 seconds.
5) Scroll up about halfway (e.g. middle-click on the scrollbar there).
6) Wait a few seconds.
7) Scroll up to about a quarter way (same as step 5)
This happens when trying to, e.g., read the trace-malloc output (or more precisely to find where it starts).
EXPECTED RESULTS: Reasonable scrolling
ACTUAL RESULTS: Every time I move by a reasonable distance, the browser freezes up for 10 seconds or so. Profiling indicates that pretty much all the time is spent under BuildTextRuns(nsIRenderingContext*, nsTextFrame*, nsIFrame*, nsLineList_iterator const*).
It looks like when we go to paint we reconstruct all the textruns for the huge block instead of limiting ourselves to the dirty area.
This is also a problem if you mouse out of the window, wait a few seconds, then mouse back in. 10-second hang.
Flags: blocking1.9?
![]() |
Reporter | |
Comment 1•18 years ago
|
||
And actually... even if I make sure to scroll pretty continuously (to prevent the textruns from timing out), scrolling up hangs like this. Scrolling down is reasonably fast. Do we construct the textrun from the beginning of the dirty rect to the end of the file or something?
Assignee | ||
Comment 2•18 years ago
|
||
This should work, something must be wrong with the backwards-scanner that finds where to start constructing textruns.
Assignee | ||
Updated•18 years ago
|
Assignee: nobody → roc
![]() |
Reporter | |
Comment 3•18 years ago
|
||
Doesn't seem like there's anything wrong with that, actually. We start at the beginning of the dirty rect or so, like I said. But we seem to keep going past the end of the dirty rect.
Assignee | ||
Updated•18 years ago
|
Flags: blocking1.9? → blocking1.9+
Assignee | ||
Comment 4•18 years ago
|
||
Okay, this seems to fix it completely for me.
The idea's very simple; we just stop building textruns after some number of lines (currently 50) after we encountered aForFrame and after we've completed a textrun.
Attachment #284740 -
Flags: review?(smontagu)
Comment 5•18 years ago
|
||
Why 50? If it's intended to be the maximum number of lines on screen, it seems a bit small. If it's derived from some other calculation, perhaps you can document it?
Assignee | ||
Comment 6•18 years ago
|
||
It's arbitrary. The goal is merely to avoid the overhead of calling BuildTextRuns too many times. Calling it at most once every 50 lines, (and constructing textruns for at most 50 lines too many, seems like a reasonable tradeoff.
Updated•18 years ago
|
Attachment #284740 -
Flags: review?(smontagu) → review+
Assignee | ||
Comment 7•18 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•18 years ago
|
||
I backed this out to see if it was responsible for a Tp regression. If it was, we may want to try uping the line limit from 50 to 500 or something.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 9•18 years ago
|
||
As far as I can tell, backing this out had no effect whatsoever on relevant performance metrics. I'll reland it when the tree opens.
Whiteboard: [needs relanding]
Whiteboard: [needs relanding] → [needs relanding][dbaron-1.9:RzCt]
Comment 10•18 years ago
|
||
relanding backed-out blockers:
Checking in layout/generic/nsTextFrameThebes.cpp;
/cvsroot/mozilla/layout/generic/nsTextFrameThebes.cpp,v <-- nsTextFrameThebes.cpp
new revision: 3.111; previous revision: 3.110
done
Status: REOPENED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 11•18 years ago
|
||
I backed it out again because we're still suspicious it's causing a Tp issue and I don't want to deal with it before M9 is done. After M9 I'll find a nice quiet time to reland it and get a few good perf runs. I may also try tweaking the line limit up to 500 or something.
Assignee | ||
Updated•18 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 12•18 years ago
|
||
Updated for checkin, with the lines to process in BuildTextRuns upped from 50 to 200 to hopefully reduce any overhead in Tp.
Attachment #284740 -
Attachment is obsolete: true
Attachment #287634 -
Flags: review+
Assignee | ||
Updated•18 years ago
|
Priority: -- → P1
Comment 13•18 years ago
|
||
Checking in layout/generic/nsTextFrameThebes.cpp;
/cvsroot/mozilla/layout/generic/nsTextFrameThebes.cpp,v <-- nsTextFrameThebes.cpp
new revision: 3.125; previous revision: 3.124
done
Status: REOPENED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Whiteboard: [needs relanding][dbaron-1.9:RzCt] → [dbaron-1.9:RzCt]
Target Milestone: --- → mozilla1.9 M10
Comment 14•18 years ago
|
||
Ugh, don't forget there's a separate bustage fix that needs to go with this patch or things turn ugly. :(
You need to log in
before you can comment on or make changes to this bug.
Description
•