Skip to content

perf: match a globstar-led glob on the last component, without a path copy - #1507

Merged
thekevinbot merged 5 commits into
mainfrom
bot/speed-walk-components-1011
Oct 13, 2026
Merged

thekevinbot merged 5 commits into
mainfrom
bot/speed-walk-components-1011

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #1480.

A **/-led glob whose remainder is one component is matched against the file's last component only, and Pattern::is_match borrows 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_only and slashed_borrows_a_native_unix_path.

case before after user CPU
./**/{a,b}*.md 58.1 ms 56.7 ms 498 -> 391 ms
./**/[a-c]*.md 63.2 ms 63.5 ms 379 -> 345 ms
./**/file?.md 72.4 ms 53.2 ms 350 -> 288 ms
./**/[[:digit:]]*.md 46.1 ms 45.5 ms 346 -> 291 ms

Wall time is walk- and syscall-bound (fd: 18-26 ms on the same cases), so only file?.md moves 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.md

Migrations

packages/rust/migrations.d/2026-10-11-faster-glob-matching.md (none needed)

E2E Verification

  • Ran e2e suites locally for every affected SDK
  • Python SDK e2e: pass
  • TypeScript SDK e2e: pass
  • Rust core e2e: cargo test --workspace --features cli pass
  • Python and TypeScript receipts written
  • Command(s) run: testing-conventions e2e attest over the glob_speed_*, stat_speed, query_contract python tests (26 passed); testing-conventions e2e attest 'pnpm test:e2e' in packages/ts (18 passed)
  • Result summary: all pass

@thekevinbot
thekevinbot marked this pull request as ready for review October 12, 2026 02:25
@thekevinbot
thekevinbot merged commit 305c4ea into main Oct 13, 2026
89 checks passed
@thekevinbot
thekevinbot deleted the bot/speed-walk-components-1011 branch October 13, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant