{"id":19831935,"url":"https://github.com/felixguendling/cpp-serialization-benchmark","last_synced_at":"2025-06-25T15:06:16.826Z","repository":{"id":45202860,"uuid":"163610096","full_name":"felixguendling/cpp-serialization-benchmark","owner":"felixguendling","description":"Comparison of C++ Serialization Libraries for Graph Data","archived":false,"fork":false,"pushed_at":"2021-12-31T16:11:46.000Z","size":70,"stargazers_count":36,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-25T15:05:58.245Z","etag":null,"topics":["benchmark","capnproto","cereal","cista","cpp","flatbuffers","high-performance","serialization"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felixguendling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-30T18:51:25.000Z","updated_at":"2025-06-11T02:45:44.000Z","dependencies_parsed_at":"2022-09-18T04:41:29.539Z","dependency_job_id":null,"html_url":"https://github.com/felixguendling/cpp-serialization-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/felixguendling/cpp-serialization-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixguendling%2Fcpp-serialization-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixguendling%2Fcpp-serialization-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixguendling%2Fcpp-serialization-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixguendling%2Fcpp-serialization-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felixguendling","download_url":"https://codeload.github.com/felixguendling/cpp-serialization-benchmark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixguendling%2Fcpp-serialization-benchmark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261896998,"owners_count":23226647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","capnproto","cereal","cista","cpp","flatbuffers","high-performance","serialization"],"created_at":"2024-11-12T11:35:45.560Z","updated_at":"2025-06-25T15:06:16.804Z","avatar_url":"https://github.com/felixguendling.png","language":"C++","readme":"# C++ Serialization Benchmark  [![Build Status](https://travis-ci.org/felixguendling/cpp-serialization-benchmark.svg?branch=master)](https://travis-ci.org/felixguendling/cpp-serialization-benchmark)\n\nThis benchmark suite accompanies the public release of the [Cista++](https://cista.rocks/) serialization library.\n\nThis repository contains benchmarks for C++ (binary \u0026 high performance) serialization libraries.\nThe goal was to create a benchmark based on a non-trivial data structure.\nIn this case, we serialize, deserialize and traverse a graph (nodes and edges).\nSince the goal was to have a data structure containing pointers, we choose an \"object oriented\" representation of a graph instead of a simple adjacency matrix.\nSome frameworks do no support cyclic data structures. Thus, instead of having node pointers in the edge object, we just reference start and destination node by their index.\nBenchmarks are based on the [Google Benchmark](https://github.com/google/benchmark) framework.\n\nThis repository compares the following C++ binary serialization libraries:\n\n  - [Cap’n Proto](https://capnproto.org/capnp-tool.html)\n  - [cereal](https://uscilab.github.io/cereal/index.html)\n  - [Flatbuffers](https://google.github.io/flatbuffers/)\n  - [Cista++](https://cista.rocks/)\n\n\n# Other Benchmarks\n\n  - Benchmarks de/serialization (Thrift, Protobuf, Boost.Serialization, Msgpack, Cereal, Avro, Capnproto, Flatbuffers, YAS) of [two arrays (numbers and strings)](https://github.com/thekvs/cpp-serializers/blob/master/test.fbs): https://github.com/thekvs/cpp-serializers\n  - Rust de/serialization benchmarks (Cap’n Proto vs. Protocol Buffers): https://github.com/ChrisMacNaughton/proto_benchmarks\n  - FlatBuffers benchmarks: https://google.github.io/flatbuffers/flatbuffers_benchmarks.html\n\n\n# Build \u0026 Execute\n\nTo run the benchmarks you need a C++17 compatible compiler and CMake. Tested on Mac OS X (but Linux should be fine, too).\n\n    git clone --recursive github.com:felixguendling/cpp-serialization-benchmark.git\n    cd cpp-serialization-benchmark\n    mkdir build\n    cd build\n    cmake -DCMAKE_BUILD_TYPE=Release ..\n    make\n    ./cpp-serialization-benchmark\n\n\n# Results\n\n| Library                                               | Serialize      | Deserialize     | Fast Deserialize |   Traverse | Deserialize \u0026 Traverse |      Size  |\n| :---                                                  |           ---: |            ---: |             ---: |       ---: |                   ---: |       ---: |\n| [Cap’n Proto](https://capnproto.org/capnp-tool.html)  |        76 ms   |    **0.00 ms**  |       **0.0 ms** |   216 ms   |               221 ms   |    50.5M   |\n| [cereal](https://uscilab.github.io/cereal/index.html) |       216 ms   |    111.00 ms    |                - |   67 ms    |               174 ms   |    37.8M   |\n| [Cista++](https://cista.rocks/) `offset`              |      **4 ms**  |      0.16 ms    |       **0.0 ms** |   67 ms    |             **66 ms**  |  **25.3M** |\n| [Cista++](https://cista.rocks/) `raw`                 |       650 ms   |     24.80 ms    |        24.8 ms   |   66 ms    |               91 ms    |   176.4M   |\n| [Flatbuffers](https://google.github.io/flatbuffers/)  |      1409 ms   |     35.70 ms    |       **0.0 ms** |   75 ms    |               75 ms    |    63.0M   |\n| [zpp_bits](https://github.com/eyalz800/zpp_bits)      |      **4 ms**  |      6.58 ms    |           6.6 ms | **65 ms**  |               72 ms    |    37.8M   |\n\nCista++ `offset` describes the \"slim\" variant (where the edges use indices to reference source and target node instead of pointers).\n\nExact results can be found [here](https://github.com/felixguendling/cpp-serialization-benchmark/blob/master/benchmark_result.txt).\n\nBenchmarks were run on Ubuntu 20.04 on an AMD Ryzen 9 5900X, compiled with GCC 11.\n\n\n## Compilation Times\n\nCompilation times are measured with code generation but without building the code generators or static libraries (Cap’n Proto, Flatbuffers).\n\n| Library                                               | clang-7 on Mac OS X |\n| :---                                                  |                ---: |\n| [Cap’n Proto](https://capnproto.org/capnp-tool.html)  |              0.440s |\n| [cereal](https://uscilab.github.io/cereal/index.html) |              1.827s |\n| [Cista++](https://cista.rocks/) `raw`                 |              1.351s |\n| [Flatbuffers](https://google.github.io/flatbuffers/)  |              0.857s |\n\n\n# Contribute\n\nYou have found a mistake/bug or want to contribute new benchmarks? Feel free to open an issue/pull request! :smiley:\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixguendling%2Fcpp-serialization-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixguendling%2Fcpp-serialization-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixguendling%2Fcpp-serialization-benchmark/lists"}