Some more improvements for attribute selector matching
Categories
(Core :: CSS Parsing and Computation, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox117 | --- | fixed |
People
(Reporter: mstange, Assigned: mstange)
References
Details
(Whiteboard: [sp3])
Attachments
(4 files, 1 obsolete file)
To speed up the testcase in bug 1837673 (attachment 9338349 [details]).
Assignee | ||
Comment 1•2 years ago
|
||
This deduplicates some checks for whether attr() is None,
and avoids a flag check in the chain iterator.
On my machine, with a local macOS arm64 --enable-release non-PGO build,
this fix reduces the time spent in has_attr
by 38% on the testcase
in bug 1837673.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
This improves the testcase in bug 1837673 by a small amount.
In this profile you can see nsAttrValue::GetStoredAtom() call BaseType(),
and then nsAttrValue::Equals(string) calls it again: https://share.firefox.dev/3p8r71q
Depends on D181346
Assignee | ||
Comment 3•2 years ago
|
||
The goal here is to inline the loop and attribute name check into the caller.
Once an attribute with a matching name is found, we do the remainder of the
checks (namespace, attribute value) with a function call.
This probably helps some cases and hurts others.
Depends on D181347
Assignee | ||
Comment 4•2 years ago
|
||
This improves the testcase in bug 1837673, because it means that we only
check attributes once. Before this patch, we would check them twice: First,
the SimpleFilter path would check for the presence of the attribute, and then
later we would enumerate attributes again to check the attribute value.
Now we don't use the SimpleFilter path anymore and go straight to attribute
enumeration.
TODO: One of the checks that this skips is a quirks mode check - what are the effects of it? Do we need to handle something about it here?
Depends on D181348
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D181347
Updated•2 years ago
|
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/50016a097d86
https://hg.mozilla.org/mozilla-central/rev/ab90251925ec
https://hg.mozilla.org/mozilla-central/rev/5b02f6714bb7
https://hg.mozilla.org/mozilla-central/rev/50d6377ff840
Description
•