GeezerVison is showing github.com — perf(id-events): memoize verified stored decodes by dezren39 · Pull Request #15654 · developing-today/code
Conversation
dezren39
commented
Nov 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- Add a bounded, generation-aware memo of fully verified stored events keyed by a fresh digest of the exact bytes read. Repeated position, by-ID, and applied-event reads reuse the verified decode; misses still take the full decode path.
- In
check_invariants, keep the already verified dependency lists from the first scan and reuse them in the second scan of the same read transaction. This avoids decoding each applied event twice without retaining a second full Event clone.
- Cap memo retention at 256 entries and 4 MiB of encoded rows; do not cache a single row larger than 64 KiB. Ingest and prune generation changes clear the memo.
Evidence
- Failing first: Fleet run 45854148561 compiled the test-only oracle on the pre-implementation commit and failed because a stored read left the cache empty.
- Focused and corruption coverage: Fleet run 45870734737, final head
82a9880, passed all 7 tests: four memo/invariant tests plus three existing corruption tests.
- Matched performance: Fleet run 45872076039 ran each named test on the same runner, first at main parent
091f77e, then at 82a9880:
test_loopback_converges_for_mixed_k_and_t: 6.77s → 6.72s
test_clear_tag_chunks_600_claims_into_three_events: 20.38s → 20.37s
test_a_batch_decides_and_stores_what_per_event_ingest_does: 33.91s → 22.80s (33% faster)
test_an_interrupted_session_restarts_without_duplicates: 6.30s → 6.33s
- Combined: 67.36s → 56.22s (16.5% less time).
rustfmt --edition 2024 --check on changed Rust files and git diff --check pass.
Merge Danger
Medium. Every cache miss recomputes the digest from the current row bytes and performs the full signature and canonical-form verification. The tests prove byte rewrites miss the memo and remain rejected as corrupt. The invariant-check reuse is scoped to one read transaction after the first full verified decode.
Closes #15328
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…5328-digest-memo-20261126T1555Z
coderabbitai
Bot
commented
Nov 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 9 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2d1f0523-b9dd-43ad-beaa-e36d25c7381d
Commits
-
Reviewing files that changed from the base of the PR and between c2b28df and 82a9880.
Files selected for processing: 3
-
pkgs/id/crates/id-events/src/event_store/anchors.rs
pkgs/id/crates/id-events/src/event_store/mod.rs
pkgs/id/crates/id-events/src/event_store/threads.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 26, 2026
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.