Closed
Bug 934788
Opened 11 years ago
Closed 11 years ago
Faster selector matching for attribute selectors by not counting the number of attributes
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: smaug, Assigned: smaug)
References
Details
(Whiteboard: [qa-])
Attachments
(2 files)
4.29 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
4.29 KB,
patch
|
Details | Diff | Splinter Review |
Currently SelectorMatches uses GetAttrCount and (safe) GetAttrNameAt to iterate over all the attributes. Use of the latter should be enough, and we can add a fast HasAttrs to Element. We may want to add a faster way to get attr count, but it just shouldn't be needed at all here. Seems to help a % or two with bug 917247. (Other things we could perhaps fix is GetAttr usage and string copying/addrefing, few % could be optimized there) https://tbpl.mozilla.org/?tree=Try&rev=6abee7f8a9d1
Attachment #827140 -
Flags: review?(bzbarsky)
Comment 1•11 years ago
|
||
Comment on attachment 827140 [details] [diff] [review] patch >+ return MappedAttrCount() || (AttrSlotCount() && mImpl->mBuffer[0]); I'd prefer AttrSlotIsTaken(0) for that last check; it's clearer as to what's really going on and why it's safe. r=me with that
Attachment #827140 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 2•11 years ago
|
||
Assignee | ||
Comment 3•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d1ea27ce8789
Comment 4•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d1ea27ce8789
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•10 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•