perf: avoid redundant relative scans on macOS ARM64#50
Merged
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
hyfdev
marked this pull request as ready for review
July 14, 2026 07:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
relativecalls on macOS AArch64 with NEON.Cowparity coverage plus multibyte UTF-8 prefix and mismatch cases.Scope
The optimized implementation is compiled only for macOS AArch64 with NEON. macOS x86_64, Windows, Linux, and other operating systems compile the previous implementation unchanged. This PR adds no
unsafeand no new benchmark cases.Performance
Compared with accepted baseline commit
886fc357f228e8a89e49103fdaa88db7eab70877on an Apple M3 Pro using the existingrelativebenchmark, with freshly built binaries in isolated target directories, 150 samples, a 2-second warm-up, and a 5-second measurement:short_common_prefixdeep_siblingsdifferent_subtreesmodule_to_cwdsame_directoryTwo full
dot_slow_pathcomparisons moved in opposite directions: one owned-result run regressed by 2.73%, then the repeat improved by 1.94%. A balanced eight-run alternation did not reproduce a regression, so this row is treated as having no demonstrated change rather than as a gain.AArch64 release IR grows from 16,665 lines and 430 copies to 16,777 lines and 431 copies. macOS x86_64 remains exactly 15,469 lines and 385 copies.
Validation
cargo fmt --all -- --checkcargo test --all-featurescargo clippy --all-targets --all-features -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurescargo check --lib --target x86_64-pc-windows-gnucargo check --lib --target x86_64-pc-windows-msvccargo check --lib --target x86_64-unknown-linux-gnuAn independent adversarial review found no remaining correctness, ownership, UTF-8, platform-scope, or safety blocker.