Repository navigation
perf(search): reuse directory-relative metadata snapshots - #945
Draft
Haoming9527 wants to merge 1 commit into
Draft
Haoming9527 wants to merge 1 commit into
Haoming9527 wants to merge 1 commit into
Conversation
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 #872 and #932. Stacked on #944; full performance acceptance remains open.
What was wrong
Search classified every directory entry twice: once through its held directory handle and again by absolute path. The relative no-follow metadata already contains symlink type and Windows reparse attributes. On the same 2,000-file corpus, a complete glob incurred 2,000 unnecessary absolute metadata queries.
The change
Reuse the directory-relative metadata for link/reparse classification. Keep content opens, child-directory no-follow checks, scan budgets, full revisions, output limits and continuation validation unchanged.
Add a diagnostic query-count regression and a real directory-link/junction exclusion test. Include raw alternating-order measurements and bilingual performance notes. No dependencies, public schemas, or runtime pins changed.
Validation
cargo test --locked --manifest-path native/Cargo.toml -p ops-search: passed; the optional writable-UNC fixture remains ignored locally.cargo clippy --locked --manifest-path native/Cargo.toml -p ops-search --all-targets -- -D warnings: passed.search-profiling,search-coverage,search-early-exit,grep-pagination,grep-multiline,grep-definitions: 30 checks passed across 6 suites, no skips/failures, using this worktree's release worker.node scripts/check-file-size.mjsandgit diff --check: passed.CI required: awaiting this PR's run. No full local gate is claimed for this slice.Unmodified
bench/search-profile.mjs, 20 measured pairs plus three retained first-touch/warmup pairs per query, alternating order, same 2,000-file corpus (62,890 bytes):Every canonical result matched and the corpus remained unchanged. This is a supplemental native one-shot benchmark including process startup and diagnostic clocks, not the attached 106-operation shell scenario. Full-scan grep still falls far short of the acceptance target; bounded scans are not substituted for complete scans. The profile attributes most remaining grep cost to per-file checked opens.
Environment
Windows x64, Ryzen 7 6800HS, Node 26.12.1, Rust 1.97.1 release, independent Cargo target directory. Baseline #944 at
24ac360551c1336453b78268090574f97a1de50ahas all 10 CI jobs green: https://github.com/T-Auto/dsh-ops/actions/runs/43608861159.Evidence and exact worker/corpus hashes.
Pull-request-triggered CI: all 10 jobs passed, including CI required and the Windows/Linux/macOS full gates: https://github.com/T-Auto/dsh-ops/actions/runs/43610781867.