Repository navigation
perf(query): batch projected UUID lookups (#530) - #771
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
5 tasks
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
[:find ?e ?a :where [?e :age ?a]]still performed a root-to-leaf DICT lookup for each returned UUID. Projection now collects up to 1,024 distinct committed ids into bounded stack hints. Dense batches reuse the existing leaf cursor; sparse/small batches keep exact scalar reads. Cache insertion, memory charges and errors retain projection order, and lookups use the query's pinned generation.The paired, NUMA-pinned 1M-fact scan improves from 261.81 to 135.55 ms p50 (48.2% lower) at about 7 MiB peak RSS. Random and descending refs improve 28.2% and 45.5%. The 64-id dense cutoff costs 7.6 µs. Repeated refs varied (+8.2% in the broad rounds, +0.5% in four follow-up pairs); all results remain published. Methods, raw results and reproduction.
Fixes #530
Type of change
Checklist
test-hooks: 1,928 passed, 16 ignored (bench)cargo clippy --all-features -- -D warningsand formatting passunwrap()/expect()in library code pathsCHANGELOG.mdand synchronized documentation updated underUnreleasedPHILOSOPHY.md: no dependencies, configuration, public API or file-format changesNotes for reviewer
The initial generic batch walker exceeded the binary budget and introduced coverage gaps. The final implementation removes that walker and encoder helper, reuses existing tree primitives, and makes no production B+tree/key changes. Scalar conversion remains authoritative after any speculative failure, including corruption encountered in skipped leaves. The dictionary visitor may produce a prefix before an error; projection discards all partial hints.
Claude approved the spec/plan revisions, final code, and final evidence/documentation review. All heavy verification and measurement ran on the bench; timing was sequential and separate from profiling, with 256 KiB probe workers. The final test enhancement received a focused rerun after the broad suites. CI's lint policy excludes test/example targets; an extra all-target lint run reports existing warnings there. Companion docs: project-minigraf/minigraf-docs#77. All 19 final core CI checks pass. Task-owned bench scratch has been removed; detailed logs and review evidence are retained locally. The codebase-wide size audit is tracked in #772 (v3.0.0), attached to production-readiness tracker #383.