Repository navigation
Speed up the path-table walk on large directories - #1321
Merged
Merged
Conversation
This was referenced Oct 5, 2026
2 tasks done
# Conflicts: # testing-conventions.toml
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.
Summary
Speed up the path-table walk on large directories. Stacked on #1319.
Fixes #1320
glob.stepfor a file only when a symlink is crossed, since only then is its result read. Build the full entry path only when a.gitignoreis in force.build_rowscuts its work from the back, so each path moves once instead of the remainder being re-copied on every cut.Red commit first:
judge_all_shares_a_large_directory_across_threads. CI on a3821fc failed on exactly that assertion (judged on 1 thread(s)) on Linux and Windows.Measurements (release build, warm cache)
SELECT path FROM './*', 1M flat files (find0.42s)SELECT count(*) FROM './*', same treeThe output is byte-identical to the base for:
./**/*.rs,./**/*,./.github/**/*.yml,./*/*and./packages/**/*.mdon this repo (with gitignores)./*,./**/*.mdand./docs/**on the 1M treeglob_speed_one_level_test(#1305) still fails. On its 2M-file tree, dirsql takes 1.78s after startup against native 0.71s (budget 0.78s). Most of what remains is SQLite stepping and JSON output, not the walk.E2E Verification
uv run python -m pytest tests/e2e/ -q --deselect tests/e2e/glob_speed_one_level_test.py, 40 passed.just e2e-attest-ts(pnpm test:e2e) passed.cargo test --workspace --features clipassed, apart from the server watcher tests that flake under load. They fail the same way on the base branch and pass alone.touch b.md a.md; dirsql query "SELECT path FROM './*'"returns[{"path":"a.md"},{"path":"b.md"}].Changelog / Migrations
packages/rust/changelog.d/2026-10-05-path-table-walk-speed.mdpackages/rust/migrations.d/2026-10-05-path-table-walk-speed.md(nothing breaks)