Research

fwJson Benchmark

Parsing performance comparison against the top JSON parsers — simdjson, yyjson, RapidJSON, and cJSON

Overall Ranking

1st
simdjson
C++ — SIMD-accelerated
2nd
yyjson
C — pure scalar, no SIMD
3rd
fwJson
C — in-place zero-copy
4th
RapidJSON
C++ — widely used
5th
cJSON
C — simple & portable

Key Findings

fwJson beats RapidJSON on every file tested — by 15% on float-heavy data up to 97% on string-heavy data. The advantage grows with string content because in-place parsing eliminates all string copying.
simdjson and yyjson are 2–3× faster than fwJson — simdjson uses SIMD instructions to process 16–64 bytes at a time. yyjson achieves similar speed with pure scalar C through compact memory layout, bump allocators, and unrolled loops.
cJSON is 2.5–7× slower than fwJson — it uses malloc per node and copies all strings, which adds up on large documents.

Visual Comparison

canada.json — 2.2 MB, float-heavy coordinates
simdjson
606 MB/s
yyjson
623 MB/s
fwJson
385 MB/s
RapidJSON
292 MB/s
cJSON
52 MB/s
citm_catalog.json — 1.7 MB, mixed types
simdjson
1,759 MB/s
yyjson
1,448 MB/s
fwJson
821 MB/s
RapidJSON
714 MB/s
cJSON
241 MB/s
twitter1-full.json — 1.0 MB, string-heavy (fwJson's strength)
simdjson
1,031 MB/s
yyjson
945 MB/s
fwJson
374 MB/s
RapidJSON
190 MB/s
cJSON
84 MB/s
epa1-full.json — 195 KB, medium-sized NGSI-LD-like data
simdjson
1,154 MB/s
yyjson
1,120 MB/s
fwJson
371 MB/s
RapidJSON
212 MB/s
cJSON
137 MB/s

Full Results

File Size fwJson RapidJSON simdjson yyjson cJSON
canada.json2,198 KB 5,572 us7,341 (1.32x) 3,593 (0.64x)3,446 (0.62x) 40,986 (7.36x)
citm_catalog.json1,687 KB 2,008 us2,307 (1.15x) 936 (0.47x)1,137 (0.57x) 6,842 (3.41x)
twitter1-full.json1,032 KB 2,691 us5,300 (1.97x) 977 (0.36x)1,066 (0.40x) 11,997 (4.46x)
salessandri-small-dict.json805 KB 1,525 us2,186 (1.43x) 735 (0.48x)638 (0.42x) 4,060 (2.66x)
snomed1-full.json490 KB 1,520 us2,477 (1.63x) 573 (0.38x)499 (0.33x) 5,638 (3.71x)
books1-full.json428 KB 1,383 us2,586 (1.87x) 579 (0.42x)484 (0.35x) 4,791 (3.46x)
epa1-full.json194 KB 512 us897 (1.75x) 165 (0.32x)170 (0.33x) 1,383 (2.70x)
ngsild-batch-upsert.json4.7 KB 8.8 us14.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.

Why fwJson Beats RapidJSON

What Makes simdjson & yyjson Faster

simdjson

yyjson

Portability: yyjson's techniques are 100% portable across all CPU architectures. simdjson requires SIMD support but includes a scalar fallback. For the fw-libs, yyjson-style optimizations are the recommended path forward — maximum performance with zero portability risk.

Methodology

Versions

Reproduce

sudo apt install libsimdjson-dev libcjson-dev
cd fwJson/bench
make
./run_bench.sh 100