-
-
Notifications
You must be signed in to change notification settings - Fork 736
perf(linter): replace phf_set with array for DOM_PROPERTIES_NAMES
#10501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(linter): replace phf_set with array for DOM_PROPERTIES_NAMES
#10501
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
phf_set with array for DOM_PROPERTIES_NAMES
Merge activity
|
a459f9e to
62178c2
Compare
CodSpeed Instrumentation Performance ReportMerging #10501 will not alter performanceComparing Summary
|
|
Graphite's |
| let right = &name; | ||
| let result = DOM_PROPERTIES_NAMES.binary_search_by(|left| { | ||
| let l = std::cmp::min(left.len(), right.len()); | ||
|
|
||
| let lhs = &left.as_bytes()[..l]; | ||
| let rhs = &right.as_bytes()[..l]; | ||
|
|
||
| for i in 0..l { | ||
| match lhs[i].to_ascii_lowercase().cmp(&rhs[i].to_ascii_lowercase()) { | ||
| std::cmp::Ordering::Equal => (), | ||
| non_eq => return non_eq, | ||
| } | ||
| } | ||
|
|
||
| left.len().cmp(&right.len()) | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this safe for multi byte chars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I’ve ported the native logic of cmp. I just tested it, and it works as expected.
no worries, merge when ready just merges once CI passes i think |

Related to #10076