Closed Bug 1201692 Opened 4 years ago Closed 4 years ago

ExplicitChildIterator::Seek leads to O(N^2) behavior during frame reconstruction

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(2 files)

This is basically a regression from bug 653881.  I should have caught it then in review...

The old seek() call on the ChildIterator in FindInsertionPrevSibling was O(1) in the common case.  But the new Seek() call on ExplicitChildIterator is O(N) in all cases, since it always does a walk along all the kids until it gets to the one we want.

We should be able to fast-path at least the common case here, I'd think: that aChildToFind is a child of mParent.  In that case, can't we just set mChild to aChildToFind and return?
Flags: needinfo?(mrbkap)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8656961 - Flags: review?(wchen) → review+
https://hg.mozilla.org/mozilla-central/rev/a1e45a92a376
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Flags: needinfo?(mrbkap)
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.