Nibblecode is a zero-copy serialization format heavily inspired[^1] by rkyv. In many cases, this is faster than rkyv, and has better ergonomics, but it sacrifices some features that you may want:
- No stream serialization (data can only be serialized into a preallocated buffer)
- No support for rust stable (this uses several nightly-only features, some for convenience (like
ptr_alignment_type
), some for core functionality (likeallocator_api
)) - I haven't gotten round to implementing all data structures (although they'd only take a few hours to implement)
- No full deserialization (the API is exclusively zero-copy, you'll have to handle conversion yourself, if needed)
Disclaimer
I made this in a week, mostly as a learning experiment, and also to see if I could beat rkyv in their own benchmarks.
This has good performance in the niche of serializing small messages, where storage size/bandwidth isn't a concern. In all other cases, I recommend bitcode, which produces tiny messages, and is also much faster than this for large messages.
Also, the documentation is very incomplete.
[^1]: I don't think I can call it a fork (it's more of a ground-up remake), since I have changed quite a lot about the core design, but the structure of the codebase is practically copied. I have kept the same license, just in case that matters.