Repository navigation
perf: scan file entries in one pass - #1556
Merged
Merged
Conversation
The one-pass scan does not bring frontmatter within 1.1x of find+xargs-P (CI 1.156x), and speed-sanity-ci times only against the previous release.
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 #1534
The scanner handles a file-only directory's entries in one pass, with no intermediate list. Frontmatter is about 2-3% faster: 100 alternating pairs of release CLI builds on the same 131,072-note corpus gave a median ratio of 0.971 for this branch against main, and 1.023 for main against this branch.
This is not enough for the fastest-native bar. With the bar set to
FASTEST, CI's runner measured 1.132xfind+xargs-Pbefore the fix and 1.156x after it, against a 1.1x limit. That difference is noise. Locally the ratio is 1.89x. This PR therefore leaves the frontmatter bar atfind+awkand leaves the native assertion out ofspeed-sanity-ci.yml, which only times against the previous release. The remaining lever, creating the DB and inserting rows during the scan, is L-sized and is tracked in #1560. #1560 also covers switching the bar toFASTEST.A borrowed-table-name variant of the match step was measured and dropped: 1.064x slower over 100 pairs.
No API change, so there is no parity drift.
E2E Verification
on_file_query_test.py,query_contract_test.py,frontmatter_parse_speed_test.py)cargo test --workspace --features cli)packages/python/e2e-attestations/<branch>.jsonreceipt written ifpackages/pythonchanged (just e2e-attest-python)packages/ts/e2e-attestations/<branch>.jsonreceipt written ifpackages/tschanged (just e2e-attest-ts)uv run python -m pytest tests/e2e/on_file_query_test.py tests/e2e/query_contract_test.py tests/e2e/frontmatter_parse_speed_test.py -x -q;pnpm test:e2e;cargo test --workspace --features cli;cargo bench -p dirsqlfind+awk(bar) and 1.887xfind+xargs-P(fastest, printed only), load 16.7.Manual CLI: on 131,072 notes the query returned four status rows of 32,768 notes each, with the expected word sums.
Changelog / Migrations
packages/rust/changelog.d/packages/rust/migrations.d/