Switching from Serde's deserialize to deserialize_in_place saves a significant amount of code size for us, due to Result<Self, Error> requiring a memcpy on success if it's part of a larger structure. It would stink to lose that option if/when we update to bincode 2.0.
If someone wants to write a PR with this, we can merge that. I've never worked with deserialize_in_place. It would be nice to add a test with serde_derive doing the proper implementation too.
Switching from Serde's
deserialize
todeserialize_in_place
saves a significant amount of code size for us, due toResult<Self, Error>
requiring a memcpy on success if it's part of a larger structure. It would stink to lose that option if/when we update to bincode 2.0.Note that https://github.com/bincode-org/bincode/issues/425 claims that
However, that's merely the default implementation, and
serde_derive
has a feature to generate properdeserialize_in_place
implementations.