Closed
Bug 14001
Opened 26 years ago
Closed 24 years ago
getElementById() is really slow
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
VERIFIED
FIXED
Future
People
(Reporter: sspitzer, Assigned: vidur)
Details
(Keywords: dom1, perf)
to quote alecf: "getElementById() is really slow in gecko's implementation. it
actually walks the _entire_ DOM"
we are using getElementById() in the js that makes up our app:
http://lxr.mozilla.org/seamonkey/search?string=getElementById
if we can speed it up, it would help all over the place.
Comment 1•26 years ago
|
||
But wait, this should only affect you if you are _not_ using XUL documents.
Where are you using vanilla HTML or XML documents?
Comment 2•26 years ago
|
||
I didn't realize they used different codepaths for XUL vs. HTML....it looks like
XUL does hash this stuff...
I originally reported this because I noticed a slight speedup on Linux (not
timed, so maybe I only saw it because I was looking for it) when I started
caching the results of getElementById() in JavaScript...
Updating to reflect the status - HTML only.
Here's the offending code:
http://lxr.mozilla.org/seamonkey/source/layout/html/document/src/nsHTMLDocument.cpp#1827
Updated•26 years ago
|
Priority: P3 → P2
Target Milestone: M11
Comment 3•26 years ago
|
||
Triage: setting this as with a TFV of M11, and a priority P2, since it's an HTML
DOM 0 bug.
Comment 4•26 years ago
|
||
HTML DOM bugs are M11/P2 for Vidur.
Assignee | ||
Comment 5•26 years ago
|
||
No question about it - we should be hashing the id. I already do that for named
HTML items and just didn't update the first pass implementation of
getElementById().
Updated•25 years ago
|
Target Milestone: M11 → M12
Comment 6•25 years ago
|
||
Moving to M12.
Assignee | ||
Updated•25 years ago
|
Target Milestone: M12 → M13
Assignee | ||
Comment 7•25 years ago
|
||
Moving off M12 radar for the time being. One or more might get back once I get a
chance to really look at them.
Assignee | ||
Comment 8•25 years ago
|
||
In an attempt to get my bug list in order again, marking all the bugs I have
currently as ASSIGNED.
Updated•25 years ago
|
Summary: [PERFORMANCE] getElementById() is really slow → [PERF] getElementById() is really slow
Bulk add of "perf" to new keyword field. This will replace the [PERF] we were
using in the Status Summary field.
Assignee | ||
Updated•25 years ago
|
Target Milestone: M13 → M14
Assignee | ||
Comment 10•25 years ago
|
||
Couldn't get this done in time. It'll be first up for M14.
Comment 11•25 years ago
|
||
On behalf of PorkJockeys: putting on beta1 radar, per beta criteria priority #2
- performance. removing extraneous perf tags, cc waterson.
Keywords: beta1
Summary: [PERF] getElementById() is really slow → getElementById() is really slow
Whiteboard: [Perf]
Comment 13•25 years ago
|
||
this is not critical for beta1. it only affects large, DOM-intensive, *HTML*
documents. if somebody thinks otherwise, please re-add the beta1 grafitti.
Assignee | ||
Comment 14•25 years ago
|
||
This bug shouldn't move any further than M16 (says the man who's going to be
gone when M16 is worked on :-)). Johnny, look at the implementation for
NamedItem. That implementation does maintain a hash table that it keeps in sync
with the document. It doesn't create the hash until the document has completed
loading, though. Unfortunately, most calls to these methods are probably during
loading. Maybe we can do better...
Target Milestone: M14 → M16
Comment 15•25 years ago
|
||
M16 has been out for a while now, these bugs target milestones need to be
updated.
Comment 16•25 years ago
|
||
This bug has been marked "future" because the original netscape engineer working
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug, or if it blocks your work in some
way -- please attach your concern to the bug for reconsideration.
Target Milestone: M16 → Future
Comment 17•24 years ago
|
||
Considering that getElementById() is the recommended method of mozilla&&netscape
to overcome IE/NS specific html and will be used a lot more in the future it
shouldn't put be to far out. Adding mozilla1.1 keyword
Keywords: mozilla1.1
Comment 18•24 years ago
|
||
Netscape-Manager-Type-People: Do we need this to meet embedding requirements?
Keywords: nsbeta1
Updated•24 years ago
|
Component: DOM Level 1 → DOM Core
Assignee | ||
Comment 19•24 years ago
|
||
Fixed by jst@netscape.com prior to XPCDOM landing. The implementation now uses
a hash table.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 21•24 years ago
|
||
verified it on both IE and netscape ...did not see any considerable difference
in the amount of time it took for displaying the Elements-by-Id
Status: RESOLVED → VERIFIED
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in
before you can comment on or make changes to this bug.
Description
•