Repository navigation
perf: match a globstar-led glob on the last component, without a path copy - #1507
Merged
Merged
Conversation
thekevinbot
marked this pull request as ready for review
October 12, 2026 02:25
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.
Refs #1480.
A
**/-led glob whose remainder is one component is matched against the file's last component only, andPattern::is_matchborrows the path text instead of copying it. Results are unchanged; the corpus is 400k files (hyperfine -N, 30 runs, load 5).Red: 3c47dea (run 38192931504) failed on
a_globstar_led_single_component_glob_matches_on_the_last_component_onlyandslashed_borrows_a_native_unix_path../**/{a,b}*.md./**/[a-c]*.md./**/file?.md./**/[[:digit:]]*.mdWall time is walk- and syscall-bound (fd: 18-26 ms on the same cases), so only
file?.mdmoves visibly; no case crosses the 1.1x tolerance and no bar flips. Stepping files through the component states was not done: it would change which dot-named files match when another word spells the dot name.Changelog
packages/rust/changelog.d/2026-10-11-faster-glob-matching.mdMigrations
packages/rust/migrations.d/2026-10-11-faster-glob-matching.md(none needed)E2E Verification
cargo test --workspace --features clipasstesting-conventions e2e attestover the glob_speed_*, stat_speed, query_contract python tests (26 passed);testing-conventions e2e attest 'pnpm test:e2e'in packages/ts (18 passed)