Feature Comparison

This is a best-effort feature comparison between rkyv, FlatBuffers, and Cap'n Proto. This is by no means completely comprehensive, and pull requests that improve this are welcomed.

Feature matrix

FeaturerkyvCap'n ProtoFlatBuffers
Open type systemyesnono
Scalarsyesnoyes
Tablesnoyesyes
Schema evolutionnoyesyes
Zero-copyyesyesyes
Random-access readsyesyesyes
Validationupfronton-demandyes
Reflectionnoyesyes
Object orderbottom-upeitherbottom-up
Schema languagederivecustomcustom
Usable as mutable statelimitedlimitedlimited
Padding takes space on wire?optionaloptionalno
Unset fields take space on wire?yesyesno
Pointers take space on wire?yesyesyes
Cross-languagenoyesyes
Hash maps and B-treesyesnono
Shared pointersyesnono

Although these features aren't supported out-of-the-box, rkyv's open type system allows extensions which provide many of these capabilities.

Open type system

One of rkyv's primary features is that its type system is open. This means that users can write custom types and control their properties very finely. You can think of rkyv as a solid foundation to build many other features on top of. In fact, the open type system is already a fundamental part of how rkyv works.

Unsized types

Even though they're part of the main library, unsized types are built on top of the core serialization functionality. Types like Box and Rc/Arc that can hold unsized types are entry points for unsized types into the sized system.

Trait objects

Trait objects are further built on top of unsized types to make serializing and using trait objects easy and safe.