Closed Bug 289311 Opened 20 years ago Closed 20 years ago

[FIX]Make the HTML content sink always preappend

Categories

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

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta2

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(2 files)

This came out in the course of working on bug 286000. The HTML content sink currently calls AppendChildTo on nodes when it parses the closing tag, except when mPreAppend is set. Since BindToTree is always deep, this means that content tree construction becomes O(N*D) where D is the depth of the tree (since each node gets bound a number of times equal to the number of its ancestors). The solution is to just switch to always preappending. This is what the XML sink does anyway, so it's preferable from that point of view. It should help address small the Tp regression introduced by bug 286000. I checked over our impls of AppendChildTo/InsertChildAt, and it looks like they should all deal fine with this change (especially, since we did already have modes where we were preappending).
Blocks: 286000
Attached patch Proposed patchSplinter Review
Attached patch Same as diff -wSplinter Review
Attachment #179865 - Flags: superreview?(jst)
Attachment #179865 - Flags: review?(bugmail)
I think we want to take this for beta2 to deal with this Tp regression....
Flags: blocking1.8b2?
Priority: -- → P1
Summary: Make the HTML content sink always preappend → [FIX]Make the HTML content sink always preappend
Target Milestone: --- → mozilla1.8beta2
Comment on attachment 179865 [details] [diff] [review] Same as diff -w sr=jst
Attachment #179865 - Flags: superreview?(jst) → superreview+
Comment on attachment 179865 [details] [diff] [review] Same as diff -w Requesting approval for this Tp regression fix. This has the added bonus of making our HTML and XML sink do things in the same order.
Attachment #179865 - Flags: approval1.8b2?
Comment on attachment 179865 [details] [diff] [review] Same as diff -w a=asa for 1.8a2 checkin.
Attachment #179865 - Flags: approval1.8b2? → approval1.8b2+
Fix checked in. With this patch, the cumulative Tp effect of all the BindToTree stuff was a slight win (maybe 1%).
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Blocks: 289730
Flags: blocking1.8b2?
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: