Closed
Bug 838642
Opened 11 years ago
Closed 11 years ago
nsContainerFrame::StealFrame is O(n)
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla22
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
References
(Blocks 1 open bug)
Details
(Keywords: perf)
Attachments
(2 files)
10.21 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
3.37 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
nsContainerFrame::StealFrame is O(n) because it iterates over the frame lists to find out which list the child is on. We don't need to do that - if the frame isn't the first/last sibling then we can simply unhook it from its siblings without updating its nsFrameList, and if it is the first or last sibling we only need to compare it to the First/LastChild() of the potential frame lists it could be on. This makes StealFrame O(1).
Assignee | ||
Comment 1•11 years ago
|
||
Boris, you've reviewed some of my nsFrameList patches in the past iirc, can you review this? Give it to roc otherwise, thanks.
Attachment #710756 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #710758 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 3•11 years ago
|
||
Try run for bug 838642, bug 838671, bug 838679, bug 838688, bug 838706: https://tbpl.mozilla.org/?tree=Try&rev=1aa9c6c26a55
Comment 4•11 years ago
|
||
Comment on attachment 710756 [details] [diff] [review] Make nsContainerFrame::StealFrame O(1) So in nsContainerFrame::StealFrame, we depend on the nsFrameList::StartRemoveFrame calls never leaving a list empty unless the StartRemoveFrame call actually happened on that list, right? That's worth commenting somewhere... This patch gives me the creeps. Can we at least assert somehow that the frame is in one of the lists involved, please? With that, r=me
Attachment #710756 -
Flags: review?(bzbarsky) → review+
Comment 5•11 years ago
|
||
Comment on attachment 710758 [details] [diff] [review] Remove nsContainerFrame::RemovePropTableFrame which is now unused r=me
Attachment #710758 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 6•11 years ago
|
||
> we depend on the nsFrameList::StartRemoveFrame calls never leaving a list empty... Yes, that is the documented behavior of StartRemoveFrame. Let me know if you find that sufficient or if you want further documentation. With some added assertions: https://hg.mozilla.org/integration/mozilla-inbound/rev/e8ca3fa39660 https://hg.mozilla.org/integration/mozilla-inbound/rev/0a77b9b02ba5
Comment 7•11 years ago
|
||
Ah, indeed. That's probably good enough, yes.
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e8ca3fa39660 https://hg.mozilla.org/mozilla-central/rev/0a77b9b02ba5
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in
before you can comment on or make changes to this bug.
Description
•