Skip to content

Functional and performance test about JSON libraries for C/C++

License

Notifications You must be signed in to change notification settings

gunjae-yoon/jsoncpp_benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON C++ Benchmark

Copyright(c) 2024 Gunjae Yoon (rnswo42b@gmail.com)

Introduction

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

Benchmarks and Measurements

Functinoal

Benchmark Description
Ordering Verify that the parsing result of JSON document maintains the order of the elements created within the JSON document.

Performance

Benchmark Description
DOM Parsing Parse JSON text which includes all structure, at once
SAX Parsing Parse each JSON elements which compose structure

Libraries

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.

JSON data

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

Build and Run

  1. Make build directory
  2. Move into build directory
  3. Prepare scripts and environments using cmake
  4. Run GNU make
$ mkdir build
$ cd build
$ cmake ..
$ make

About

Functional and performance test about JSON libraries for C/C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published