Skip to content

Test one-level glob listings at speed of light - #1317

Merged
thekevinscott merged 75 commits into
mainfrom
claude/1305-glob-speed
Oct 6, 2026
Merged

thekevinscott merged 75 commits into
mainfrom
claude/1305-glob-speed

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Speed-of-light e2e test for one-level listings: './*', './' and './docs' over a wide flat root and docs/, beside subdirectories a one-level listing must not read, plus dotfiles it must hide. Native is find -mindepth 1 -maxdepth 1 -type f ! -name '.*'; a bash glob loses by an order of magnitude here (11-15s vs 0.5s on a 1M-entry directory) because it must stat every entry to drop directories.

Fixes #1305

Status: dirsql misses the bar

Rows match native for all three globs. Speed does not (local run, 2M-entry directories, startup 0.046s):

Glob native dirsql ratio
'./*' 0.685s 6.410s 9.3x
'./' 0.766s 7.041s 9.2x
'./docs' 0.736s 6.892s 9.4x

Profile on a 1M-entry directory (release CLI, SELECT path FROM './*'): find 0.45s, dirsql 2.5-3.5s.

  • One statx per matched file (980k calls, 11-25s of system time across the stat workers) to fill size/mtime/ctime, even when the statement reads only path. A serial stat of the same files costs find 6.8s on this filesystem, so the parallel stat is right when those columns are read and pure overhead when they are not.
  • With the stat removed, dirsql still takes 1.6s: the walk 0.9s (the directory read alone is 0.18s), row building 0.17s, SQLite and JSON output 0.55s.

The fix lands in follow-up PRs stacked on this one.

E2E Verification

  • Ran e2e suites locally for every affected SDK
  • Python SDK e2e: pass (55 passed)
  • TypeScript SDK e2e: pass (18 passed)
  • Rust core e2e (if applicable): unit suite pass (cargo test -p dirsql --features cli --lib)
  • packages/python/e2e-attestations/claude-1305-glob-speed.json receipt written (just e2e-attest-python)
  • packages/ts/e2e-attestations/claude-1305-glob-speed.json receipt written (just e2e-attest-ts)
  • Command(s) run: uv run maturin develop --release in packages/python, then just e2e-attest-python, just e2e-attest-ts
  • Result summary: full suites green. Two earlier Python runs each failed one wall-clock speed-of-light case by under 0.5% of budget (./docs 0.753s vs 0.750s, ./docs/ 0.616s vs 0.614s); both cases passed when rerun alone, and the third full run passed.

The repeated-column test fails: a projection naming a column twice writes its key twice.
…on spare cores

The sibling test fails: every directory is explored on the calling thread.
thekevinbot and others added 9 commits October 6, 2026 02:59
test: glob speed of light across matcher forms (stacked on #1317)
test: glob speed of light with symlinks (stacked on #1317)
test: glob speed of light with .gitignore (stacked on #1317)
test: glob speed of light with node_modules (stacked on #1317)
…ects

kind_of takes its stat as an argument so a followed and an unfollowed link are judged without a real symlink, and run_default writes to a given writer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Glob speed: one-level listings ('./*', './docs', './')

2 participants