felixguendling / cpp-serialization-benchmark

Comparison of C++ Serialization Libraries for Graph Data
MIT License
32 stars 2 forks source link

serialize_size of fbs_bench can't be recurrenced #3

Closed westfly closed 4 years ago

westfly commented 4 years ago

Thanks for your Reply

I'm building the repo with GCC 9.3

➜  build git:(master) gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Run benchmark at my PC or Cloud Machine the serialize_size of fbs_bench Only 62.998M while benchmark_result.txt declaring 378.018M , but the serialize_size of cista_raw_bench is nearly same. my result

BM_SERIALIZE<fbs_bench>                                         3951 ms         3938 ms            1 size=62.998M 
BM_SERIALIZE<cista_raw_bench>                                   1827 ms         1828 ms            1 size=176.378M
BM_SERIALIZE<cista_offset_bench>                                1846 ms         1844 ms            1 size=176.378M

benchmark_result.txt

BM_SERIALIZE<fbs_bench>                                         2349 ms         2349 ms            6 size= 378.018M
BM_SERIALIZE<cista_raw_bench>                                   3555 ms         3555 ms            4 size=176.396M
BM_SERIALIZE<cista_offset_bench>                                3494 ms         3493 ms            4 size=176.396M

full result showing as below

2020-09-04 18:08:30
Running ./cpp-serialization-benchmark
Run on (8 X 2400 MHz CPU s)
Load Average: 0.52, 0.58, 0.59
---------------------------------------------------------------------------------------------------------------------
Benchmark                                                          Time             CPU   Iterations UserCounters...
---------------------------------------------------------------------------------------------------------------------
BM_SERIALIZE<capnp_bench>                                        168 ms          172 ms            3 size=50.5093M
BM_SERIALIZE<cista_offset_slim_bench>                           9.26 ms         9.42 ms           78 size=25.317M
BM_SERIALIZE<cereal_bench>                                       264 ms          266 ms            3 size=37.829M
BM_SERIALIZE<fbs_bench>                                         3951 ms         3938 ms            1 size=62.998M
BM_SERIALIZE<cista_raw_bench>                                   1827 ms         1828 ms            1 size=176.378M
BM_SERIALIZE<cista_offset_bench>                                1846 ms         1844 ms            1 size=176.378M
BM_SAFE_DESERIALIZE<capnp_bench>                               0.002 ms        0.002 ms       373333
BM_SAFE_DESERIALIZE<cista_offset_slim_bench>                   0.259 ms        0.256 ms         2987
BM_SAFE_DESERIALIZE<fbs_bench>                                  78.1 ms         78.1 ms            9
BM_SAFE_DESERIALIZE<cista_offset_bench>                          355 ms          352 ms            2
BM_SAFE_DESERIALIZE<cista_raw_bench>                             539 ms          547 ms            1
BM_SAFE_DESERIALIZE<cereal_bench>                                202 ms          203 ms            3
BM_FAST_DESERIALIZE<cista_raw_bench>                            53.8 ms         57.8 ms           10
BM_TRAVERSE<cista_raw_bench>                                     244 ms          240 ms            3 nodeCount=1.87k
BM_TRAVERSE<cista_offset_slim_bench>                             238 ms          240 ms            3 nodeCount=1.87k
BM_TRAVERSE<cista_offset_bench>                                  236 ms          229 ms            3 nodeCount=1.87k
BM_TRAVERSE<cereal_bench>                                        252 ms          250 ms            3 nodeCount=1.87k
BM_TRAVERSE<fbs_bench>                                           266 ms          255 ms            3 nodeCount=1.87k
BM_TRAVERSE<capnp_bench>                                         424 ms          430 ms            2 nodeCount=1.87k
BM_FAST_DESERIALIZE_AND_TRAVERSE<cista_offset_slim_bench>        204 ms          208 ms            3 nodeCount=1.87k
BM_FAST_DESERIALIZE_AND_TRAVERSE<cista_offset_bench>             208 ms          208 ms            3 nodeCount=1.87k
BM_FAST_DESERIALIZE_AND_TRAVERSE<cista_raw_bench>                264 ms          266 ms            3 nodeCount=1.87k
BM_FAST_DESERIALIZE_AND_TRAVERSE<fbs_bench>                      244 ms          245 ms            3 nodeCount=1.87k
BM_FAST_DESERIALIZE_AND_TRAVERSE<cereal_bench>                   401 ms          406 ms            2 nodeCount=1.87k
BM_FAST_DESERIALIZE_AND_TRAVERSE<capnp_bench>                    355 ms          359 ms            2 nodeCount=1.87k
felixguendling commented 4 years ago

I updated the README to list the value 63M for Flatbuffers. I have no idea where the other value is coming from. Maybe I updated Flatbuffers after creating the benchmark.

Edit: Or maybe it's from an old implementation. Previously, I used uint instead of ushort as datatype for Flatbuffers: https://github.com/felixguendling/cpp-serialization-benchmark/commit/42b22c7ddf19050a3b875b567213b80373348e33#diff-94e7a093f8c26c0e645a3ff0663febe6

westfly commented 4 years ago

thanks for your replay