Repository navigation
perf(sessions): batch canonical observation body reads - #4738
Closed
ScriptedAlchemy wants to merge 1 commit into
Closed
ScriptedAlchemy wants to merge 1 commit into
ScriptedAlchemy wants to merge 1 commit into
Conversation
|
Owner
Author
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.
Finding
The canonical observation decoder issues one awaited SQLite query per distinct content hash, including from the existing batched session projection-observation read. A single observation with many large fields therefore serializes round trips to the same registered store, even though the body hashes are already known together.
Change
INbatches of at most 16 distinct hashes. The existing observation-to-body authority, store identity, and transaction/snapshot still govern the read; this creates no second cache or worker.Regression
An actual SQLite-backed
TestConnectionfixture builds one valid observation containing 18 distinct external bodies and a repeated body reference. A query-counting adapter on the real read port requires 2 bounded SQL reads instead of 18. It also checks the fully reconstituted observation and typed missing-body and hash-corruption refusals.Verification / limits
masteradbf0e391bd7; GitHub comparison confirms one fast-forward commit changing onlycrates/tracedecay-session-temporal-store/src/query.rs. Checked error precedence, identity, deduplication, parameter bounds and materialization fallback at source level.bazel test //crates/tracedecay-session-temporal-store:unit_test --test_output=errorsand formatting on this exact head. A query-count regression is not an elapsed-time speedup measurement.This is a focused hot-path optimization found while reviewing open performance/storage issues; it does not claim to resolve the broader corpus, graph publication, or storage-growth incidents.