Closed
Bug 407889
Opened 17 years ago
Closed 17 years ago
Reduce allocations for nsDisplayListBuilder::mCaretStates and mFramesMarkedForDisplay
Categories
(Core :: Layout, defect, P1)
Tracking
()
RESOLVED
FIXED
People
(Reporter: roc, Assigned: roc)
Details
Attachments
(2 files)
7.89 KB,
patch
|
MatsPalmgren_bugz
:
review+
MatsPalmgren_bugz
:
superreview+
|
Details | Diff | Splinter Review |
28.92 KB,
patch
|
MatsPalmgren_bugz
:
review+
MatsPalmgren_bugz
:
superreview+
|
Details | Diff | Splinter Review |
We can use nsAutoTArray here to reduce heap allocations. We should also change mFramesMarkedForDisplay so that instead of accumulating frames and only unmarking them at the end of the lifetime of the nsDisplayListBuilder, we unmark frames when we leave their presshell. This will reduce the max number of elements needed in mFramesMarkedForDisplay.
Flags: blocking1.9?
Comment 1•17 years ago
|
||
+ing to continue our assault on memory usage and allocations..
Flags: blocking1.9? → blocking1.9+
Priority: -- → P1
Assignee | ||
Comment 2•17 years ago
|
||
I'm also going to fix HitTest so that instead of allocating an array at each recursion level, we share single nsAutoTArray for the whole stack.
Assignee | ||
Comment 3•17 years ago
|
||
This patch reorganizes the per-presshell state in nsDisplayListBuilder. The main goal is to remove frames from mFramesMarkedForDisplay when we leave the presshell for those frames, which means mFramesMarkedForDisplay won't need to get so large. Then we make the relevant nsTArrays nsAutoTArray instead.
Attachment #292936 -
Flags: superreview?(mats.palmgren)
Attachment #292936 -
Flags: review?(mats.palmgren)
Assignee | ||
Comment 4•17 years ago
|
||
Using a single buffer for all nested nsDisplayList::HitTest calls, and make that buffer an nsAutoTArray. This should basically eliminate all allocations in this code.
Attachment #293047 -
Flags: superreview?(mats.palmgren)
Attachment #293047 -
Flags: review?(mats.palmgren)
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs review]
Comment 5•17 years ago
|
||
Comment on attachment 293047 [details] [diff] [review] fix HitTest This patch seems to have a bug somewhere. Try drag-selecting text on http://www.mozilla.org/projects/minefield/ I see a lot of flicker... (Linux debug 64-bit) I'll continue the review tomorrow but wanted to give you a heads up in case you want to start investigate that problem...
Comment 6•17 years ago
|
||
Comment on attachment 292936 [details] [diff] [review] fix mCaretStates/mFramesMarkedForDisplay Looks good. r+sr=mats The initial capacity numbers can perhaps be tuned? I added a bit of tracing and looked at a few hundred pages from Alexa Top 500 and a few other selected pages on Wikipedia etc. I could not find any page that used more than 3 PresShellState, so maybe we should start with 4 instead of 8?
Attachment #292936 -
Flags: superreview?(mats.palmgren)
Attachment #292936 -
Flags: superreview+
Attachment #292936 -
Flags: review?(mats.palmgren)
Attachment #292936 -
Flags: review+
Comment 7•17 years ago
|
||
Comment on attachment 293047 [details] [diff] [review] fix HitTest This patch doesn't work correctly for me. Drag-selecting text flickers, nothing happens when clicking in the toolbar/urlbar etc.
Attachment #293047 -
Flags: superreview?(mats.palmgren)
Attachment #293047 -
Flags: superreview-
Attachment #293047 -
Flags: review?(mats.palmgren)
Attachment #293047 -
Flags: review-
Assignee | ||
Comment 8•17 years ago
|
||
These PresShellStates are small so I think leaving it at 8 is harmless. I'll look into the problem in the other patch.
Assignee | ||
Comment 9•17 years ago
|
||
(In reply to comment #7) > (From update of attachment 293047 [details] [diff] [review]) > This patch doesn't work correctly for me. Drag-selecting text flickers, > nothing happens when clicking in the toolbar/urlbar etc. I'm not seeing any of these problems :-(
Assignee | ||
Comment 10•17 years ago
|
||
Mats, do you have any other platforms available you could check on?
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs review]
Comment 11•17 years ago
|
||
Comment on attachment 293047 [details] [diff] [review] fix HitTest My apologies, I must have missed that one of the hunks for nsDisplayList.h was rejected by 'patch' -- with that fixed it works fine. r+sr=mats
Attachment #293047 -
Flags: superreview-
Attachment #293047 -
Flags: superreview+
Attachment #293047 -
Flags: review-
Attachment #293047 -
Flags: review+
Assignee | ||
Comment 12•17 years ago
|
||
Both patches checked in. Thanks!
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•