-
Notifications
You must be signed in to change notification settings - Fork 138
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
Is possible that decoder support PacketRef? #166
Comments
Hey @simon-fu, I've run into the same problem too when trying to do a zero-copy decode. We could likely improve this in v0.6 since we would be making breaking changes to the API. That being said, have you found that to be a major performance problem? Packets are generally small so the allocation should be pretty fast. My previous ideas:
|
Just wanted to note that this seems related: #109 |
Yep, a similar concern, but just at the output side. Thanks for your patience regarding that PR. I'm fairly confident we can address both issues in v0.6, but I just want to get a bunch of quality and performance fixes out in v0.5.2 first. I have many new thoughts to share on the relationship between |
Thanks for reply. |
Suppose application has a fixed buffer to store every packet data, but before invoking Decoder::decode() it must invoke Packet::new() to alloc data first. That make poor performance. Is possible that add a new type PacketRef and change decode function signature to Decoder::decode(&PacketRef) ?
The PacketRef look like:
pub PacketRef<'a> { .. the same as Packet, data: &'a [u8], }
The text was updated successfully, but these errors were encountered: