Closed Bug 280293 Opened 20 years ago Closed 20 years ago

Don't use nsIDOMNode:GetNextSibling() -- it is an O(n) operation

Categories

(Core :: Disability Access APIs, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

Details

(Keywords: access, perf)

Attachments

(1 file)

nsAccessibleTreeWalker actually does extra work to use
nsIDOMNode::GetNextSibling() instead of using something that indexes a child
from the parent.

It turns out this makes Gecko do a lot more work. GetNextSibling() has to use
IndexInParent() to do its work.
It'll take me some time to get to this; I'm pretty swamped with reviews...
Comment on attachment 172785 [details] [diff] [review]
Use nsIContent::GetChildAt() except at top of doc, where we'll now use GetChildNodes() which is similar to the nsIDOMNodeList walking we already do for anon content

sr=bzbarsky
Attachment #172785 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 172785 [details] [diff] [review]
Use nsIContent::GetChildAt() except at top of doc, where we'll now use GetChildNodes() which is similar to the nsIDOMNodeList walking we already do for anon content

verbal r= timeless
Attachment #172785 - Flags: review?(bugmail) → review+
Checking in accessible/src/base/nsAccessibleTreeWalker.h;
/cvsroot/mozilla/accessible/src/base/nsAccessibleTreeWalker.h,v  <-- 
nsAccessibleTreeWalker.h
new revision: 1.7; previous revision: 1.6
done
Checking in accessible/src/base/nsAccessibleTreeWalker.cpp;
/cvsroot/mozilla/accessible/src/base/nsAccessibleTreeWalker.cpp,v  <-- 
nsAccessibleTreeWalker.cpp
new revision: 1.11; previous revision: 1.10
done
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Keywords: perf
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: