-
-
Notifications
You must be signed in to change notification settings - Fork 622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rkyv, avoid the copy to byte ? #2573
Comments
IIRC you can convert the rkyv type into a boxed slice, and then Bytes from a boxed slice, without copies. Any interest in making a PR? |
That will be my first PR but yes definitely! |
Just dug into AlignedVec implementation, converting the AlignedVec into a Boxed slice via into_boxed_slice reallocates, "This method reallocates and copies the underlying bytes. Any excess capacity is dropped.". I will try something else. |
Apparently, it works directly with the AlignedVec. Don't know why it failed, before. Please forget that (non) issue |
Looking at the code, I think there is a copy that shoul dbe avoided in the following code:
There is the serialization, which is fine and gives an
AlignedVec
that is then re-encoded a Bytes.The annoyance comes from
Bytes::copy_from_slice(encoded.as_ref());
Is there a way to send the
AlignedVec
directly ?The text was updated successfully, but these errors were encountered: