WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
239545
Avoid call to convertToASCIILowercase() in SelectorFilter::collectElementIdentifierHashes() in the common case
https://bugs.webkit.org/show_bug.cgi?id=239545
Summary
Avoid call to convertToASCIILowercase() in SelectorFilter::collectElementIden...
Chris Dumez
Reported
2022-04-20 09:08:45 PDT
Avoid call to convertToASCIILowercase() in SelectorFilter::collectElementIdentifierHashes() in the common case.
Attachments
Patch
(2.24 KB, patch)
2022-04-20 09:12 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2022-04-20 09:12:51 PDT
Created
attachment 457993
[details]
Patch
Sam Weinig
Comment 2
2022-04-20 14:42:49 PDT
Comment on
attachment 457993
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=457993&action=review
> Source/WebCore/css/SelectorFilter.cpp:50 > + AtomString tagLowercaseLocalName = LIKELY(element.isHTMLElement() && !element.isUnknownElement()) ? element.localName() : element.localName().convertToASCIILowercase();
A comment explaining this assumption would be useful even with the assert.
EWS
Comment 3
2022-04-20 15:12:34 PDT
Committed
r293123
(
249826@main
): <
https://commits.webkit.org/249826@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 457993
[details]
.
Radar WebKit Bug Importer
Comment 4
2022-04-20 15:13:29 PDT
<
rdar://problem/92054703
>
Darin Adler
Comment 5
2022-04-20 17:44:46 PDT
Comment on
attachment 457993
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=457993&action=review
>> Source/WebCore/css/SelectorFilter.cpp:50 >> + AtomString tagLowercaseLocalName = LIKELY(element.isHTMLElement() && !element.isUnknownElement()) ? element.localName() : element.localName().convertToASCIILowercase(); > > A comment explaining this assumption would be useful even with the assert.
The classic way to do this is to write a function named localNameIsKnownToBeLowercase or localNameMayContainUppercaseASCII. Then that function is the perfect place for the comment explaining why the rule is correct, and here the code is more obviously correct.
Chris Dumez
Comment 6
2022-04-20 18:10:49 PDT
(In reply to Darin Adler from
comment #5
)
> Comment on
attachment 457993
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=457993&action=review
> > >> Source/WebCore/css/SelectorFilter.cpp:50 > >> + AtomString tagLowercaseLocalName = LIKELY(element.isHTMLElement() && !element.isUnknownElement()) ? element.localName() : element.localName().convertToASCIILowercase(); > > > > A comment explaining this assumption would be useful even with the assert. > > The classic way to do this is to write a function named > localNameIsKnownToBeLowercase or localNameMayContainUppercaseASCII. Then > that function is the perfect place for the comment explaining why the rule > is correct, and here the code is more obviously correct.
Oh, I missed Sam's comment before landing. Sorry about that. I'll follow-up.
Chris Dumez
Comment 7
2022-04-20 18:52:27 PDT
0.38% progression on Speedometer on Intel, neutral on Apple Silicon.
Chris Dumez
Comment 8
2022-04-20 19:08:43 PDT
(In reply to Darin Adler from
comment #5
)
> Comment on
attachment 457993
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=457993&action=review
> > >> Source/WebCore/css/SelectorFilter.cpp:50 > >> + AtomString tagLowercaseLocalName = LIKELY(element.isHTMLElement() && !element.isUnknownElement()) ? element.localName() : element.localName().convertToASCIILowercase(); > > > > A comment explaining this assumption would be useful even with the assert. > > The classic way to do this is to write a function named > localNameIsKnownToBeLowercase or localNameMayContainUppercaseASCII. Then > that function is the perfect place for the comment explaining why the rule > is correct, and here the code is more obviously correct.
Done in <
https://commits.webkit.org/r293138
>.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug