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

Add Bincode 2 support #297

Closed
wants to merge 1 commit into from
Closed

Add Bincode 2 support #297

wants to merge 1 commit into from

Conversation

markbt
Copy link

@markbt markbt commented Feb 2, 2023

Bincode 2.0 will include its own traits for encoding and decoding, which are more efficient than going via serde.

I opened bincode-org/bincode#612 to add implementations for smallvec, however the recommendation there is that these traits should be implemented in the smallvec crate instead. This PR adds a new feature bincode2, which, when enabled, adds implementations of the new bincode traits for SmallVec.

I see a roughly 10% improvement in my benchmarks when using the new bincode traits directly vs using serde, so this would be a useful feature to have.

Because there is already a dev-dependency on Bincode 1 used in tests, I've called this feature bincode2. That can be changed if you'd prefer the feature to be called bincode.

Bincode 2.0 will include its own traits for encoding and decoding, which are more efficient than going via `serde`.

Add implementations of these traits for `SmallVec` if the `bincode2` feature is enabled.
@mbrubeck
Copy link
Collaborator

Thanks! I would like to wait to publish this until bincode 2.0 has a stable release. You could also upgrade the dev-dependency to bincode 2 if you like.

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #298) made this pull request unmergeable. Please resolve the merge conflicts.

@mbrubeck mbrubeck deleted the branch servo:master September 20, 2023 17:19
@mbrubeck mbrubeck closed this Sep 20, 2023
@mbrubeck
Copy link
Collaborator

(This was auto-closed because the master branch was deleted. You may re-submit this pull request against the v2 branch.)

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.

None yet

3 participants