Repository navigation
Use Bytes for DATA payloads - #178
Merged
Merged
Conversation
This was referenced Nov 9, 2026
Merged
boivie
force-pushed
the
feature-bytes-4
branch
2 times, most recently
from
November 9, 2026 13:50
a2c1af5 to
c408601
Compare
boivie
force-pushed
the
feature-bytes-4
branch
2 times, most recently
from
November 10, 2026 08:05
5582b59 to
d36c130
Compare
boivie
force-pushed
the
feature-bytes-4
branch
from
November 10, 2026 12:34
d36c130 to
2a943ee
Compare
DanilChapovalov
left a comment
Collaborator
There was a problem hiding this comment.
lots of small blocks.
I was wondering if 'from_bytes' could be preserved at least for tests, but concluded it can't.... [unless RawChunk would be changed to keep owned Bytes, but that defeat the purpose of the optimization].
So asking to split API changes from the optimization.
btw, this optimization adds some complexity - RawChunk has pub fields, but same time got invariants regarding offset & packet & view relation. I wonder if such extra complexity is worth the saved atomic increments.
Collaborator
Author
|
I will split this commit into API + optimization; Just give me some time |
boivie
force-pushed
the
feature-bytes-4
branch
from
November 10, 2026 14:26
2a943ee to
c78288a
Compare
DanilChapovalov
previously approved these changes
Nov 10, 2026
boivie
dismissed
DanilChapovalov’s stale review
November 11, 2026 09:44
The merge-base changed after approval.
boivie
force-pushed
the
feature-bytes-4
branch
2 times, most recently
from
November 11, 2026 21:33
019731e to
462dd1a
Compare
DanilChapovalov
previously approved these changes
Nov 12, 2026
This changes the payload of DATA and I-DATA chunks (Data::payload) from Vec<u8> to bytes::Bytes, completing the transition to Bytes for message payloads throughout the RX and TX paths.
boivie
force-pushed
the
feature-bytes-4
branch
from
November 12, 2026 11:54
462dd1a to
0285fe9
Compare
DanilChapovalov
approved these changes
Nov 12, 2026
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.
This changes the payload of DATA and I-DATA chunks (Data::payload) from
Vec to bytes::Bytes, completing the transition to Bytes for message
payloads throughout the RX and TX paths.
NOTE: There will be a follow-up pull request to optimize this further, to avoid unnecessary atomic reference count increments, which happen a lot while parsing. This PR is more mechanical to use Bytes for DATA paylods.