Skip to content
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

Remove unnecessary copies in the Rust interface #41

Merged
merged 10 commits into from
Jul 30, 2024
Merged

Conversation

tweedegolf-marc
Copy link
Contributor

At some point, the data that was received was copied; either when receiving or when unpacking a nested message.

In this latter point (since encryption/decryption can happen in-place), that was unfortunate. But even in other scenarios not needlessly duplicating the payload data (which after all might be large) is a good idea.

@tweedegolf-marc tweedegolf-marc force-pushed the elim-copy branch 4 times, most recently from 2f97ae1 to 35dda2b Compare July 23, 2024 14:47
Signed-off-by: Marc Schoolderman <[email protected]>
@tweedegolf-marc tweedegolf-marc marked this pull request as ready for review July 24, 2024 19:44
@tweedegolf-marc
Copy link
Contributor Author

tweedegolf-marc commented Jul 24, 2024

Note: since this PR touches a lot of things, the individual commits separate out the various changes in a better way. Still brooding on a way to remove a copy in the async reception case. Also added a feature flag that eliminates all copies in the pure Rust interface. Perhaps that should be the default, but the solution should be tested in combat a bit better to see if there's any major interface changes.

In hindsight, it would have been better to use ranges + objects instead of Rust slices.

These mentioned changes are in PR #44 which can be merged into this one.

@marlonbaeten marlonbaeten merged commit d693f8d into main Jul 30, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants