Closed
Bug 41119
Opened 24 years ago
Closed 23 years ago
nsFrameManager destructor is slow, maybe avoid frame destruction notification?
Categories
(Core :: Layout, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla0.9.7
People
(Reporter: buster, Assigned: bryner)
References
Details
(Keywords: perf)
Attachments
(1 file, 3 obsolete files)
3.74 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
FrameManager owns the frame tree. When FrameManager is destroyed, it destroys the frame tree. As each frame is destroyed, it notifies the FrameManager about it's destruction. Is this really necessary? The only reason I can see for doing this is to free up any properties stored on behalf of frame in a hash table owned by the FrameManager. Maybe there's a more efficient way of doing this, since few frames store properties, and few properties actually need destructors called (some are just basic types like ints, some are pointers to other frames like Waterson's secondary frame pointers.) This will effect page transition time. Thoughts?
Comment 1•24 years ago
|
||
A frame still needs to notify the frame manager when its destroyed; e.g., by a resize reflow or some DOM operation. Maybe the optimization is to add a "fast path" destroy method that accepts a "notify frame manager" argument? E.g., class nsFrame { public: Destroy(nsIPresContext* aPresContext, PRBool aNotify = PR_TRUE); }; Only the frame manager would ever call Destroy(presContext, PR_FALSE); Alternatively, you could try unhooking the pres content from the pres shell before destroying the frame tree: nsFrame::Destroy() tries to get the shell, and will only notify the frame manager if the pres context *has* a shell. Not sure what other effects this would have...
This bug has been marked "future" because we have determined that it is not critical for netscape6.0. If you feel this is an error, or if it blocks your work in some way -- please attach your concern to the bug for reconsideration. We may reopen this bug during the performance improvement phase of the project, if the frame destructor turns out to be a bottleneck for page transition. assigning to waterson so it's on his bug list.
Updated•24 years ago
|
Status: NEW → ASSIGNED
Updated•23 years ago
|
Target Milestone: Future → mozilla0.9.6
Updated•23 years ago
|
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Assignee | ||
Comment 3•23 years ago
|
||
I can take this.
Assignee: waterson → bryner
Status: ASSIGNED → NEW
Assignee | ||
Comment 4•23 years ago
|
||
Don't we already free up the properties by calling DestroyPropertyList() from nsFrameManager::Destroy() ?
Assignee | ||
Comment 5•23 years ago
|
||
I still need to do perf testing with this, but I can't do that very well at home.
Assignee | ||
Comment 6•23 years ago
|
||
This also avoids flushing reflows for the destroyed frames.
Attachment #57898 -
Attachment is obsolete: true
Assignee | ||
Comment 7•23 years ago
|
||
Let's try this again, without including part of the outliner content model patch.
Attachment #59205 -
Attachment is obsolete: true
Might you need to make nsPresShell::Destroy call CancelAllReflowCommands to avoid leaking reflow commands?
Assignee | ||
Comment 9•23 years ago
|
||
make sure to call CancelAllReflowCommands()
Attachment #59209 -
Attachment is obsolete: true
Comment on attachment 59406 [details] [diff] [review] patch v2.2 r=dbaron, except you don't need the member initializer and you can remove all the other member initializers since nsPresShell uses a ZEROING_OPERATOR_NEW.
Attachment #59406 -
Flags: review+
Comment 12•23 years ago
|
||
AFAICT, this change seems to be mandating that frame properties _cannot_ rely on being finalized when the pres shell is destroyed. This would imply that 1) any dynamic allocation for a property must happen from the pres shell's arena, and 2) properties _must not_ hold owning references to objects outside the pres shell. I think that this added constraint is reasonable, but you'll need to look at the clients of nsIFrameManager::SetFrameProperty to verify that they all play by the rules. For example, nsBlockBandData::StoreMaxElementSize will leak an nsSize object, no? Or am I confused?
nsFrameManager::Destroy calls DestroyPropertyList. Isn't that sufficient?
Comment 14•23 years ago
|
||
Okay, missed that path. sr=waterson
Assignee | ||
Comment 15•23 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•