Closed Bug 240850 Opened 21 years ago Closed 19 years ago

nsContentUtils::GetFirstDifferentAncestors should use nsIContent

Categories

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

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bzbarsky, Assigned: sicking)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

nsContentUtils::GetFirstDifferentAncestors uses nsIDOMNode, which involves calling GetParentNode a bunch. GetParentNode has to QI; this makes it noticeably slower than nsIContent::GetParent. I suspect that we could win easily here if we only do two QIs up front and then work with nsIContent throughout the method.... Thoughts? Maybe the caller is what should be working with nsIContent, by the way....
Keywords: perf
Actually, the entire compare-tree-position code should be rewritten. The code in txXPathNodeUtils::comparePosition is a lot faster, and even that could be improved in the cases where we don't have to take multiple documents into account.
Assignee: general → bugmail
Out of curiousity, if we improve compareTreePosition enough, could txXPathNodeUtils::comparePosition be removed? Or does standalone need it?
transformiix doesn't live in, or link to, gklayout.dll so that won't work. Furthermore it needs to be able to compare nodes in different trees, as well as compare nodes that are in subtrees outside of the main document, which probably would be a perfhit on the nsContentUtils one.
Blocks: 240849
Attached patch WIPSplinter Review
This is not done and doesn't even compile yet iirc. Just don't want to loose the patch
All this code is long since rewritten now.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
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: