Closed
Bug 456123
Opened 16 years ago
Closed 3 years ago
Speed up GetAttribute by skipping the qualified name stuff if none of our attrs are namespaced
Categories
(Core :: DOM: Core & HTML, defect, P5)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: bzbarsky, Unassigned)
Details
Attachments
(1 file)
6.23 KB,
patch
|
Details | Diff | Splinter Review |
We do a whole bunch of string-manipulation in GetAttribute, on the off chance that the passed-in string happens to contain a ':' and that we happen to have a namespaced attribute. See comments in bug 453738. I think we should be able to make this faster.
Reporter | ||
Updated•16 years ago
|
Summary: [FIX]Speed up GetAttribute → Speed up GetAttribute
Reporter | ||
Comment 1•16 years ago
|
||
Based on the data in bug 453738 it seemed like this should help, but it doesn't seem to, at least on the dromaeo getAttribute test. Though that test does seem to be using getAttribute("id"), so perhaps the atom-to-string conversions are simply overwhelming everything else that's going on. I'd love to have our strings and atoms be in the same charset. :(
Reporter | ||
Comment 2•16 years ago
|
||
John, it might make sense to change the dromaeo test to test a variety of attributes, since I suspect that the performance characteristics will be pretty different for things like "id", <input>'s "type" attribute, and a random made-up attribute. jorendorff, would you mind testing this proof-of-concept, which should even let the browser start, unlike the other patch I asked you to test.
Comment 3•16 years ago
|
||
This makes a tight loop on getAttribute 8% faster (on top of the other stuff in bug 453738).
Reporter | ||
Comment 4•16 years ago
|
||
So the real way to make this patch work would be to keep a bit for whether we have namespaced attrs, and check that bit here. Probably not worth it, given the small size of the win, I suspect.
Assignee: bzbarsky → nobody
Summary: Speed up GetAttribute → Speed up GetAttribute by skipping the qualified name stuff if none of our attrs are namespaced
Updated•16 years ago
|
QA Contact: content
I think it'd be faster to not create a nsAttrName at all before first looping through all attributes to check for attributes without a prefix and with the localnameatom matching the passed in string.
Comment 6•6 years ago
|
||
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
Assignee | ||
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
Comment 7•3 years ago
|
||
The relevant code has changed so much that this bug may not be too useful at this point.
Certainly there aren't so much NS_ConvertUTF16toUTF8 and such happening and atom creation is faster and
also comparing a string to an atom is better these days.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•