Skip to content

Conversation

@shulaoda
Copy link
Member

@shulaoda shulaoda commented Apr 18, 2025

Related to #10076

@github-actions github-actions bot added A-linter Area - Linter C-performance Category - Solution not expected to change functional behavior, only performance labels Apr 18, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@shulaoda shulaoda changed the title perf(linter): replace phf_set with array in DOM_PROPERTIES_NAMES perf(linter): replace phf_set with array for DOM_PROPERTIES_NAMES Apr 18, 2025
@shulaoda shulaoda marked this pull request as ready for review April 18, 2025 18:19
@graphite-app
Copy link
Contributor

graphite-app bot commented Apr 18, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 04-19-perf_linter_replace_phf_set_with_array_in_dom_properties_names branch from a459f9e to 62178c2 Compare April 18, 2025 18:22
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 18, 2025

CodSpeed Instrumentation Performance Report

Merging #10501 will not alter performance

Comparing 04-19-perf_linter_replace_phf_set_with_array_in_dom_properties_names (62178c2) with main (9280707)

Summary

✅ 36 untouched benchmarks

@graphite-app graphite-app bot merged commit 62178c2 into main Apr 18, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 04-19-perf_linter_replace_phf_set_with_array_in_dom_properties_names branch April 18, 2025 18:25
@shulaoda
Copy link
Member Author

shulaoda commented Apr 18, 2025

Graphite's Merge when ready did not recognize the reviewer, causing the PR to merge unexpectedly. 😰
Could you help me review it again? @camc314

@shulaoda shulaoda requested a review from camc314 April 18, 2025 18:26
Comment on lines +1108 to +1123
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())
});
Copy link
Contributor

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?

Copy link
Member Author

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.

@camc314
Copy link
Contributor

camc314 commented Apr 18, 2025

Graphite's Merge when ready did not recognize the reviewer, causing the PR to merge unexpectedly. 😰 Could you help me review it again? @camc314

no worries, merge when ready just merges once CI passes i think

graphite-app bot pushed a commit that referenced this pull request Apr 20, 2025
…10508)

Related to #10498, #10500, #10501

I benchmarked it incorrectly, which led to a flawed conclusion for large datasets. See #10076 for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants