View all files | ||||
Compare various data serialization libraries for C++.
This project does not have any external serialization libraries dependencies. All (boost, thrift etc.) needed libraries are downloaded and built automatically, but you need enough free disk space (approx. 2.3G) to build all components. To build this project you need a compiler that supports C++14 features. Project was tested with Clang and GCC compilers.
Following results were obtained running 1000000 serialize-deserialize operations 50 times and then averaging results on a typical desktop computer with Intel Core i7 processor running Ubuntu 16.04. Exact versions of libraries used are:
| thrift-binary | 17017 | 1190.22 |
| thrift-compact | 13378 | 3474.32 |
| protobuf | 16116 | 2312.78 |
| boost | 17470 | 1195.04 |
| msgpack | 13402 | 2560.6 |
| cereal | 17416 | 1052.46 |
| avro | 16384 | 4488.18 |
| yas | 17416 | 302.7 |
| yas-compact | 13321 | 2063.34 |
For capnproto and flatbuffers since they already store data in a "serialized" form and serialization basically means getting pointer to the internal storage, we measure full build/serialize/deserialize cycle. In the case of other libraries we measure serialize/deserialize cycle of the already built data structure.
| capnproto | 17768 | 400.98 |
| flatbuffers | 17632 | 491.5 |
Size measured in bytes, time measured in milliseconds.