Repository navigation
perf: build path-table rows on the walk threads - #1510
Merged
Merged
Conversation
7 tasks done
Merged
8 tasks done
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 #1474
Path-table rows are now built on the walk worker threads, so building them overlaps the walk instead of running serially afterwards. Each row is also smaller: 80 bytes instead of 104. The path is a
Box<str>, the scanned path aBox<Path>, and the basename/dir/ext spans are niche-packedNonZeroU32. Output is byte-identical (same md5 over all 341k rows).Timings
SELECT path FROM './**/*.md'on the 400k-fileglob_speed_recursivetree (341k matches). Runs are paired and interleaved, 40 each, medians shown. Other agents were running, load 3 to 8.5.fd --no-ignore -t f -g '*.md'That takes the gap from 1.77x fd to 1.51x. Phase breakdown (stderr stamps):
I measured both parts separately. Rows-in-walk alone gave 71.5 to 60.8 ms (hyperfine). The row shrink gave a further 69 to 63 ms against rows-in-walk (hyperfine), and fewer page faults (22.9k to 19.4k).
Remaining gap (not in this PR):
fill_cellat 28% self time (from_utf8_lossyplus a copy intoValue::Text),sqlite3Stepat 20%,value_refat 15% and serde string escaping at 13%. Writing JSON straight fromValueReftext would skip the copy and the validation.E2E Verification
testing-conventions e2e attest 'uv run python -m pytest tests/e2e/glob_speed_recursive_test.py tests/e2e/glob_speed_one_level_test.py tests/e2e/glob_speed_depth_bound_test.py tests/e2e/glob_speed_gitignore_test.py tests/e2e/glob_speed_dotfiles_test.py tests/e2e/glob_speed_matchers_test.py tests/e2e/glob_speed_node_modules_test.py tests/e2e/glob_speed_symlink_test.py tests/e2e/stat_speed_test.py tests/e2e/query_contract_test.py -q'. Result: 26 passed. The module was built withuv run maturin develop --releaseandcargo build --release -p dirsql --features cli.just e2e-attest-ts. Result: 18 passed.cargo test --workspace --features cli: pass.cargo bench -p dirsql: ran clean.Manual run:
dirsql querywithpath,basename,dir,ext,sizeandcontent, over root-relative,../and absolute globs. Every column reads correctly, and the full./**/*.mdoutput matches main byte for byte.Changelog / Migrations
packages/rust/changelog.d/2026-10-13-path-rows-built-on-walk-threads.mdpackages/rust/migrations.d/2026-10-13-path-rows-built-on-walk-threads.md: not breaking, all subsections_None._