Copyright(c) 2024 Gunjae Yoon (rnswo42b@gmail.com)
This benchmark evaluates the conformance and performance of JSON libraries for C/C++. In this project, performance means parsing and accessing speed, and memory usages for maintaining the SAX structure. JCBM is used as namespace. JCBM means as follows.
- J: JSON
- C: CPP
- B: Benchmark
- M: Measure
Benchmark | Description |
---|---|
Ordering | Verify that the parsing result of JSON document maintains the order of the elements created within the JSON document. |
Benchmark | Description |
---|---|
DOM Parsing | Parse JSON text which includes all structure, at once |
SAX Parsing | Parse each JSON elements which compose structure |
Currently 3 libraries are successfully benchmarked.
Library | Language | Version | Notes |
---|---|---|---|
Nlohmann/json | C++ | v3.11.3 | |
RapidJSON | C++ | v1.1.0 | |
taocpp/json | C++ | 1.0.0-beta.14 | Uses PEGTL for parsing |
Libraries with Git repository will be automatically downloaded by the build process and referenced after they are built.
All tested JSON data were written in UTF-8.
JSON file | Size | Description |
---|---|---|
json_flat_1mb.json source |
1,010 KB | |
json_nested_1mb.json source |
4,399 KB |
- Make
build
directory - Move into
build
directory - Prepare scripts and environments using cmake
- Run GNU
make
$ mkdir build
$ cd build
$ cmake ..
$ make