Closed
Bug 386122
Opened 18 years ago
Closed 18 years ago
Performance of loading large pages of text has regressed
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: ispiked, Assigned: roc)
References
Details
(Keywords: perf, regression)
Attachments
(2 files, 1 obsolete file)
12.52 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
4.27 KB,
patch
|
pavlov
:
review+
|
Details | Diff | Splinter Review |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a6pre) Gecko/20070622 Minefield/3.0a6pre
The time it takes to load large pages of text; e.g. full Tinderbox logs, has regressed.
Steps to reproduce:
1. Load http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1182983866.1001.gz&fulltext=1
In a build BEFORE the textframe landing I see the following memory usage:
start browser: 30K
load page: 60K
navigate away to a few other pages: 40K
and with a build AFTER the textframe landing:
start browser: 30K
load page: 400K (slowly drops off back to 70K)
navigate away to a few other pages: 40K
The textframe build also seems to use more CPU and pretty much hangs my browser when it's loading. I think this occurs on Linux, too, but my testing was done only on Windows XP.
Assignee | ||
Comment 1•18 years ago
|
||
This should help a bit. Peak memory usage will still be pretty high as it loads but it should be less, and you should see lower memory usage while you're scrolling around. Maybe I should add some textrun stats...
Assignee: nobody → roc
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•18 years ago
|
||
Comment on attachment 270270 [details] [diff] [review]
patch
This is completely bogus
Attachment #270270 -
Attachment is obsolete: true
Assignee | ||
Comment 3•18 years ago
|
||
Local version of the testcase in my debug build, so these are rough numbers:
Before patch:
Elapsed time: 19003 (ms)
Textrun storage high water mark=286860357 (bytes)
After patch:
Elapsed time: 7126 (ms)
Textrun storage high water mark=23970784 (bytes)
So I think this upcoming patch helps a lot...
Assignee | ||
Comment 4•18 years ago
|
||
The basic idea here is to allow text runs to end at preformatted newline boundaries, instead of forcing the entire file of preformatted text into one textrun. I change StylesMatchForTextRun to ContinueTextRunAcrossFrames and add the newline check in there. Also:
-- Clean up HasTerminalNewline and provide it as a static function as well as a virtual method
-- Don't pack next-in-flows into the same mMappedFlow if there's a preformatted newline present (otherwise ContinueTextRunAcrossFrames is not called)
-- In CharacterDataChanged and AdjustOffsetsForBidi, we now need to explicitly clear text runs for all in-flows: their text runs may no longer correspond to reality and calling ClearTextRun on the first-in-flow will only kill its textrun, not any other textruns which may be owned by next-in-flows.
Attachment #270277 -
Flags: review?(smontagu)
Assignee | ||
Comment 5•18 years ago
|
||
This lets us capture the (approximate) high-water-mark of textrun memory usage, which is very useful for measuring this sort of testcase.
Attachment #270278 -
Flags: review?(pavlov)
Comment 6•18 years ago
|
||
Comment on attachment 270278 [details] [diff] [review]
textrun memory-usage instrumentation
please add 2 more spaces to the second line here:
+ if (aTextRun->GetFlags() & gfxTextRunFactory::TEXT_IS_PERSISTENT) {
+ bytesPerChar += (aTextRun->GetFlags() & gfxTextRunFactory::TEXT_IS_8BIT) ? 1 : 2;
Attachment #270278 -
Flags: review?(pavlov) → review+
Updated•18 years ago
|
Attachment #270277 -
Flags: review?(smontagu) → review+
Comment 7•18 years ago
|
||
Please make that DEBUG_roc or something. Most developers don't need to see textrun stats.
Assignee | ||
Comment 8•18 years ago
|
||
OK I will, although it's only 1 line of output.
Assignee | ||
Comment 9•18 years ago
|
||
Checked in the gfx patch accidentally as part of the patch for bug 9101...
Assignee | ||
Comment 10•18 years ago
|
||
Checked in the layout patch.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 11•18 years ago
|
||
Could this have caused bug 386584?
![]() |
||
Comment 13•18 years ago
|
||
roc, would it make sense to only clear some text runs in the append case? Or is figuring out what the first impacted frame is too much pain?
Assignee | ||
Comment 14•18 years ago
|
||
Actually I think clearing all the text runs is usually a good idea. During a big load we won't need most of those text runs again; clearing them early helps free up memory. (Some of them won't be released because they're associated with cached words, but others will go.)
Updated•18 years ago
|
Flags: in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•