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

Support for BinarySlice to avoid allocation #139

Merged
merged 2 commits into from
Aug 13, 2022

Conversation

TobiasBengtsson
Copy link
Collaborator

For optimized applications where we need to read binary data (for example calculating checksums), I propose to add a new type BinarySlice<T> along the current Binary<T> in order to avoid allocation/copying. This type can only be used as a parameter and not return value on the Rust side, since modifying the binary string is not allowed. For our usage, this improves the running time by about -20%.

Up for discussion: should we keep this in binary_slice or move it to binary?

Please let me know if there is a need for additional documentation somewhere.

@TobiasBengtsson
Copy link
Collaborator Author

@davidcole1340 hope I have fixed the fmt issues now.

@TobiasBengtsson TobiasBengtsson merged commit a404834 into davidcole1340:master Aug 13, 2022
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.

1 participant