Repository navigation
Path-table walk: explore sibling subdirectories in parallel - #1328
Merged
Merged
Conversation
…on spare cores The sibling test fails: every directory is explored on the calling thread.
…aude/1325-parallel-walk
…aude/1325-parallel-walk
Base automatically changed from
claude/1326-stream-rows
to
claude/1305-glob-speed
October 6, 2026 00:10
9 of 12 tasks
This was referenced Oct 6, 2026
Closed
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.
Fixes #1325
Stacked on #1327.
The directory walk, used by path-table scans and the startup scan, now hands its directories to a depth-first walk in
tree_walk.rs. Workers on spare cores explore directories ahead of the visiting. Exploring a directory means:The calling thread hands the results out in walk order, so which files each glob returns, and their order, do not change. Workers start only after the walk has found 16 directories, so a small tree never spawns a thread.
Red commit 8b8306f:
sibling_directories_are_explored_on_more_than_one_threadfailed in CI, because every directory was explored on the calling thread.tests/path_table_parallel_scan.rschecks that two path-tables in one statement walk their trees at the same time. Its trees were 50 sibling directories, and each walk now spreads those across the cores, so the two walks no longer had idle cores to overlap on. Each tree is now a chain of 50 nested directories. A single walk then never has two directories to read at once, so the test still measures exactly the overlap between the two walks.Measurements
Wall time, best of 3,
/usr/bin/time, release builds, #1327 compared with this PR:findSELECT count(*) FROM './**/*.md'SELECT path FROM './**/*.md'SELECT count(*) FROM './*'SELECT path FROM './*'SELECT path FROM './**/*.rs'(mean of 20)SELECT path FROM './*'(mean of 50)Both speed-of-light e2e tests pass locally against this build:
glob_speed_one_level_test.py(Glob speed: one-level listings ('./*', './docs', './') #1305)glob_speed_recursive_test.py(Glob speed: recursive '**' and a literal prefix #1306, from Test recursive and prefixed globs against find at speed of light #1323)I compared output from the #1327 binary and this one on 15 queries:
.gitignorefilesAll 15 are byte-identical.
E2E Verification
just e2e-attest-python(pytest tests/e2e/): 43 passed. I also ran Test recursive and prefixed globs against find at speed of light #1323'sglob_speed_recursive_test.py: 2 passed.just e2e-attest-ts(pnpm test:e2e) passed.cargo test -p dirsql --features cli --no-fail-fastpassed, except the watcher testserver_drops_the_rows_of_a_directory_moved_out_of_the_root. That test also fails in a full run on Stream the CLI's JSON rows #1327, and it passes 3 times out of 3 when its binary runs on its own.Changelog / Migrations
packages/rust/changelog.d/2026-10-05-path-table-parallel-walk.mdpackages/rust/migrations.d/2026-10-05-path-table-parallel-walk.md(nothing breaks)