Home

Awesome

JSON Benchmark

Benchmark JSON library performance in C/C++.

Requirement

Building

Clone this repository and initialize submodules:

git clone https://github.com/ibireme/yyjson_benchmark.git
cd yyjson_benchmark
git submodule update --init

Build and run:

mkdir build
cd build
cmake ..
cmake --build . --config Release
./run_benchmark -o report.html

If you want to build with other compiler or IDE, try these commands:

# Clang for Linux/Unix:
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++

# Microsoft Visual Studio for Windows:
cmake .. -G "Visual Studio 16 2019" -A x64
cmake .. -G "Visual Studio 16 2019" -A Win32

# Xcode for macOS:
cmake .. -G Xcode

# Xcode for iOS:
cmake .. -G Xcode -DCMAKE_SYSTEM_NAME=iOS

If you want to build for arm64 device, you should add flag-DSIMDJSON_IMPLEMENTATION=arm64 for simdjson.

Results

Benchmark reports with interactive charts (update 2020-12-12)

PlatformCPUCompilerOSReport
Intel NUC 8i5Core i5-8259Umsvc 2019Windows 10 2004Charts
Intel NUC 8i5Core i5-8259Uclang 10Ubuntu 20.04Charts
Intel NUC 8i5Core i5-8259Ugcc 9.3Ubuntu 20.04Charts
AWS EC2 c5a.largeAMD EPYC 7002gcc 9.3Ubuntu 20.04Charts
AWS EC2 t4g.mediumGraviton2 (ARM64)gcc 9.3Ubuntu 20.04Charts
Apple iPhone 12 ProA14 (ARM64)clang 12iOS 14Charts

JSON Datasets

FileSizeFormatContentInfo
twitter616.7KBprettyThe most commonly used test data from MiliYip.common
twitterescaped549.2KBminifySame as twitter, with unicode escaped.common
github_events63.6KBprettyGitHub event data from GitHub API.common
canada2.1MBminifyContour of Canada border from MiloYip.full-length double
citm_catalog1.6MBprettyA big benchmark file with indentation from RichardHightowerrepeated integers<br/> and strings
lottie282.2KBminifyLottie animation data downloaded from LottieFilesshort string and number
gsoc-20183.2MBprettyGSoC Data of 2018.long ASCII string
poet3.4MBprettyPoet data from chinese-poetrylong CJK string
fgo46.5MBminifyConfig data dumped from Japanese mobile game "Fate/Grand Order"real-world large file
otfcc63.3MBminifyOpenType data dumped from NotoSansJP-Regular.otf with otfccreal-world large file