Coder Social home page Coder Social logo

dbtdsilva / cpp-serializers-benchmark-feature Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thekvs/cpp-serializers

0.0 1.0 0.0 921 KB

Benchmark and feature comparison among various data serialization libraries (thrift, protobuf, msgpack, cereal, avro, bson, flatbuffers, capnpro) for C++

CMake 8.06% C++ 88.53% R 0.82% Cap'n Proto 0.25% Protocol Buffer 0.27% Thrift 0.30% Shell 0.55% Python 0.65% Gnuplot 0.58%

cpp-serializers-benchmark-feature's Introduction

About

Compare various data serialization libraries for C++.

Build

This project does not have any external library dependencies. All (boost, thrift etc.) needed libraries are downloaded and built automatically, but you need enough free disk space to build all components. To build this project you need a compiler that supports C++11 features. Project was tested with GCC 4.8.2 (Ubuntu 14.04).

$ git clone https://github.com/thekvs/cpp-serializers.git
$ mkdir /path/to/build-root/
$ cd /path/to/build-root/
$ cmake /path/to/cpp-serializers -DCMAKE_BUILD_TYPE=Release
$ make

Usage

  • Test all serializers, run each serializer 100000 times:
$ ./benchmark 100000
  • Test only protobuf serializer, run it 100000 times:
$ ./benchmark 100000 protobuf
  • Test protobuf and cereal serializers only, run each of them 100000 times:
$ ./benchmark 100000 protobuf cereal

Results

Following results were obtained running 1000000 serialize-deserialize operations 50 times and then averaging results on a typical desktop computer with Intel Core i5 processor running Ubuntu 14.04. Exact versions of libraries used are:

  • thrift 0.9.3
  • protobuf 3.1.0
  • boost 1.62.0
  • msgpack 2.0.0
  • cereal 1.2.1
  • avro 1.8.1
  • capnproto 0.5.3
  • flatbuffers 1.4.0
serializer object's size avg. total time
thrift-binary 17017 13763
thrift-compact 11597 27017
protobuf 12571 21034
boost 17470 22945
msgpack 11902 23560
cereal 17416 10688
avro 12288 31750
Size

Size

Time

Time

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.

serializer object's size avg. total time
capnproto 17768 4396
flatbuffers 17632 12494

Time

Size measured in bytes, time measured in milliseconds.

cpp-serializers-benchmark-feature's People

Contributors

anight avatar dbtdsilva avatar jgoldfar avatar kentonv avatar sannis avatar thekvs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.