This tool runs benchmarking of deserialization performance with the Google Benchmark library (tag: v1.8.4, the latest version supporting C++11) against fkYAML and some C++ YAML library.
Currently, the following C++ YAML libraries tagged with the specified versions respectively:
Currently, the following files are located in the tool/benchmark/cases directory for benchmarking:
- ubuntu.yml
- a copy from the .github/workflows directory at the point of the commit 7092059
- for the benchmarking of an ordinary size/content benchmark
- citm_catalog.json
- a copy from the miloyip/nativejson-benchmark repository (tag: v1.0.0)
- for the benchmarking of a large JSON file
- citm_catalog.yml
- a YAML version of citm_catalog.json
- for the benchmarking of a large YAML file
Suggestions are always welcome. Please open a discussion or create a PR.
Build and run this tool with the following commands:
$ cd path/to/fkYAML
$ cmake -S . -B build -DCMAKE_BUILD_TYPE={Debug|Release} -DFK_YAML_RUN_BENCHMARK=ON
$ cmake --build build --config {Debug|Release}
# You can specify an arbitrary input file such as /foo/bar/sample.yml or /foo/bar/sample.json
$ ./build/tool/benchmark/benchmarker ./tool/benchmark/macos.yml
Then, you should see a console ouput from the Google Benchmark library in the following format.
-------------------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
-------------------------------------------------------------------------------------
bm_fkyaml_parse xxxxx ns xxxxx ns xxxxx bytes_per_second=xx.xxxxMi/s items_per_second=xx.xxxxk/s
...
Visit the user guide in the Google Benchmark repository for more information on the output format.