Closed Bug 240572 Opened 20 years ago Closed 3 years ago

Consider hashing results of getElementsByAttribute

Categories

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

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bzbarsky, Unassigned)

References

Details

Now that getElementsByAttribute returns a content list, we could hash the return
values like we do for getElementsByTagName.  This would require that we push
more members up to nsContentListKey, though (and maybe make the key generation
more complicated).

Thoughts?
Depends on: 240186
my thoughts: I wouldn't stress out about it. If it shows up in profiles we could
reconsider.

As brendan said in some other bug: premature optimizations is the root of all evil. 
Agreed re premature optimizations in general, but if an optimization is obvious
and trivial, I see little reason not to do it, as seems to be the case here.

I.e. add two more members to the nsContentListKey, and update the hash
generation and key comparison methods to take those into account. No extra bloat
(since the members are already there, they'd just be moved), just a tiny bit of
new code, and very little extra cost for the old cases and a good optimization
for the new cases.

I say it wouldn't be a waste of time to do this.
Assignee: general → nobody
QA Contact: ian → general
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML

No stress had and no time (not) wasted.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
Resolution: WORKSFORME → WONTFIX
You need to log in before you can comment on or make changes to this bug.