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?
14 years ago
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.
You need to log in before you can comment on or make changes to this bug.