
The Fastest Way to Parse JSON in Every Language (Benchmark)
I benchmarked JSON parsing across 5 languages JSON parsing is something every developer does daily. But the performance difference between languages — and between libraries in the same language — is massive. Test: Parse a 10MB JSON file Language Library Time Memory C simdjson 12ms 11MB Rust serde_json 45ms 24MB Go encoding/json 180ms 85MB Python orjson 95ms 35MB Python json (stdlib) 450ms 120MB Python ujson 210ms 65MB Node.js JSON.parse 120ms 90MB Node.js simdjson-js 55ms 30MB Surprises Python's orjson is 4.7x faster than stdlib json. If you parse large JSON in Python, pip install orjson is the single biggest performance win. simdjson is alien technology. It uses SIMD CPU instructions to parse JSON. 12ms for 10MB. That's parsing at 830MB/s. Go's stdlib is surprisingly slow. It's correct and safe, but for large payloads, consider encoding/json/v2 or jsoniter . Python: orjson vs json import json import orjson import time data = open ( ' large.json ' , ' rb ' ). read () # stdlib start = t
Continue reading on Dev.to Python
Opens in a new tab




