Share bytes by Arc in keyhive protocol#236
Merged
Merged
Conversation
13cfa40 to
75804b3
Compare
75804b3 to
a067229
Compare
alexjg
approved these changes
Jun 8, 2026
expede
approved these changes
Jun 9, 2026
expede
left a comment
Member
There was a problem hiding this comment.
Mostly a couple style / long term legibility questions, but the actual functionality seems good!
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.
Store the periodic event cache's serialized events as
Arc<[u8]>and hand every peer-pair sync responseArcdupes instead of deep-copying the byte set.During cold start of a new peer, we normally sync exactly the entire public set of keyhive ops from the server to the peer. When there are many concurrent peers cold-starting at the same time, we don't want to copy those bytes unnecessarily. The cache now builds that map once per refresh and shares it by
Arc.Testing
Arc-sharing semantics ofevents_for_peer_pair(shared on the public-only path, a fresh map on the private path) and the byte round-trips.periodic_cache) for the refresh build cost and an opt-in dhat heap membench (cache/membench.rs, behind a newdhat-heapfeature) that measures the working set for the periodic keyhive op cache.