Repository navigation
perf(broadcast): transfer reclaimed head message directly on receive - #390
Merged
Merged
Conversation
orthur2
approved these changes
Nov 1, 2026
orthur2
left a comment
Contributor
There was a problem hiding this comment.
LGTM. The try_receive doc still describes the old (Arc<T>, Reclaimed<T>) return.
Member
Author
|
Resolved in d8facec. Merging ... |
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
Arc<T>directly to the caller whenBacklog::receivevacates the front of the buffer, instead of cloningslot.msgunder the channel lock and routing the originalArc<T>throughReclaimed<T>only to drop it inshare_msg/take_msg.Received<T>to{ msg: Arc<T>, reclaimed: bool }, keepingReclaimed<T>exclusively forBacklog::remove_receiverwhen a dropped subscription vacates an unread prefix.BoundedSender'srelease_reclaimedagainstfreed == 0and only invoke it when a receive actually vacates the head slot, avoiding an unconditionalOrdering::Acquireload ofblocked_senderson non-reclaiming receives.BoundedReceiver<T>andUnboundedReceiver<T>methods into a singleimpl<T>block per receiver using method-levelwhere T: Clonebounds onrecv_clonedandtry_recv_cloned.recv/try_recvpath in ecosystem adapters and compare shared vs. clonedStringfan-out in primitive benchmarks, and drop the redundantCloneimplementation onPanicOnDropin integration tests.