Repository navigation
perf(executor): per-file glob match without staging allocs (#681) - #685
Merged
Merged
Conversation
glob_vector_expand built a fresh Vec<char> per candidate; reuse one scratch buffer per directory (same class as #281). alt_matches_slice matches the sub-slice in place (gmatch reads name[0..len] only). Sort untouched (slice b follow-up). Matcher-heavy 2000 files: reject-all -20%, accept-all -12%. Battery 34/34; lib 595/595. GNU: lib/glob/glob.c:641 glob_vector.
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.
perf(executor): per-file glob match without staging allocs (#681)
What
Slice (a) of the glob per-file residual:
glob_vector_expandbuilt afresh
Vec<char>per candidate file, andalt_matches_slicecopiedevery extglob sub-slice. GNU matches in the byte domain
(
lib/glob/glob.c:641 glob_vector).Fix
scratch: Vec<char>per directory instead of aper-candidate
collect()(same class as the [perf] Incremental reader deep system: batch tokenizer re-lexes O(buffer) per appended line (nvm -n 720x / OpenSSH -n timeout residual) #281Vec<char>removal).
alt_matches_slicematches&name[s..srest]in place (gmatchonly reads
name[0..len];sm_loop.c:843/881).casefold/extglob/nullglob/failglob paths unchanged.
Measured (release, interleaved + GNU ref)
27_glob1000×300*: within noise (loop+readdir dominate).*a*b*c*reject-all −20%;*f*e*accept-all −12%. Counts agree GNU/before/after.Verification
glob_vector_expand_scratch_reuse_matches.glob_diff.sh34/34 vs GNU;issue316_*8/8;08-glob-matchingPASS under both.
cargo test --lib595/595.Test-level 3 NEW, all in the known-nondeterministic
part_080coproc family — each green in isolation AND across 3 consecutive
part_080file runs on branch (whose only failure is the shared,order-dependent
unclosed_arithmetic_subscript, identical onmaster). No regression.
6295367, only rubash[patch]switched): failure sets byte-identical (49=49).