Parsing performance comparison against the top JSON parsers — simdjson, yyjson, RapidJSON, and cJSON
| File | Size | fwJson | RapidJSON | simdjson | yyjson | cJSON |
|---|---|---|---|---|---|---|
| canada.json | 2,198 KB | 5,572 us | 7,341 (1.32x) | 3,593 (0.64x) | 3,446 (0.62x) | 40,986 (7.36x) |
| citm_catalog.json | 1,687 KB | 2,008 us | 2,307 (1.15x) | 936 (0.47x) | 1,137 (0.57x) | 6,842 (3.41x) |
| twitter1-full.json | 1,032 KB | 2,691 us | 5,300 (1.97x) | 977 (0.36x) | 1,066 (0.40x) | 11,997 (4.46x) |
| salessandri-small-dict.json | 805 KB | 1,525 us | 2,186 (1.43x) | 735 (0.48x) | 638 (0.42x) | 4,060 (2.66x) |
| snomed1-full.json | 490 KB | 1,520 us | 2,477 (1.63x) | 573 (0.38x) | 499 (0.33x) | 5,638 (3.71x) |
| books1-full.json | 428 KB | 1,383 us | 2,586 (1.87x) | 579 (0.42x) | 484 (0.35x) | 4,791 (3.46x) |
| epa1-full.json | 194 KB | 512 us | 897 (1.75x) | 165 (0.32x) | 170 (0.33x) | 1,383 (2.70x) |
| ngsild-batch-upsert.json | 4.7 KB | 8.8 us | 14.0 (1.59x) | 3.1 (0.35x) | 3.8 (0.43x) | 21.9 (2.48x) |
Times in microseconds (lower is better). Ratio vs fwJson in parentheses (<1.00 = faster, >1.00 = slower).
100 iterations per file. CPU time via CLOCK_THREAD_CPUTIME_ID. All parsers compiled with -O2.
CLOCK_THREAD_CPUTIME_ID — CPU time consumed by the calling thread only-O2#ifdef DEBUG guard)sudo apt install libsimdjson-dev libcjson-dev
cd fwJson/bench
make
./run_bench.sh 100