-
Notifications
You must be signed in to change notification settings - Fork 31
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
Change Encode/Decode to use Read/Write instead of Cursor/Vec #860
Comments
Some thoughts on implementation: we could change |
(I don't know if this is the right place to pile-on, so feel free to redirect me.) While working on new features for the codec traits, I suggest we consider what would be needed, if anything, to make an implementation of DAP zero-copy. Concretely, the |
Depending on how you rules-lawyer "zero-copy", I don't think we can truly do zero-copy decoding, because we always transform field elements into Montgomery representation before working with them, and thus couldn't use a Streamed decoding is also at odds with zero-copy decoding, because things like the With all that said, I think we currently achieve "no unnecessary copies" pretty well, and the same could be done using |
You're right that we can't make the system truly zero-copy, but there are probably some heavy hitters we can address. Take HPKE decryption of report shares: A naive implementation would copy each report share into its own buffer, decrypt, and dump the plaintext in another buffer. Ideally we would have a ciphertext of type |
Going all the way back to #166, here was the argument for not doing
I think that's still true. However I do like the ergonomics of using |
I think a zero-copy implementation without If we use BTW, what traits are we considering using, concretely? I think edit: see nrc/portable-interoperable#5 for the current state of standard "async read/write" traits -- tl;dr is that it's not done yet |
My opinion is that we shouldn't try to design the Instead, I think it would make sense for DAP aggregator implementations to use a separate trait or separate open-coded decoding routines for top level messages (relying on |
Originally posted by @branlwyd in #675 (comment)
The text was updated successfully, but these errors were encountered: