-
Notifications
You must be signed in to change notification settings - Fork 4
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
(Packable) Pack and unpack byte buffers faster #26
Conversation
Why is a lot of format being changed when the CI wasn't complaining about it ? |
Because we didn't have a |
Ah my bad, I missed the fact you added it. |
This PR changes the
Packable
implementations ofVec<T>
,Box<[T]>
,VecPrefix<T, B>
andBoxedSlicePrefix<T, B>
in order to specialize them whenT
is equal tou8
.Before this changes. packable would do something like
to pack any byte buffer, meaning that each byte will trigger one write in the packer. With the changes proposed here. Byte buffers are packed and unpacked in a single read/write. Some benchmarks show a 6x performance improvement.
I ran the test suite of packable using miri given that this code relies on unsafe heavily, No issues were found.