Benchmark: gzipped JSON matches binary formats in size, decompresses at ~270MB/s per core

cis_female · x · 2026-09-21

Arguing against "JSON is unsuitable for performance-critical paths," the author shows that after GZIP compression JSON's size difference vs binary formats like protobuf/msgpack is negligible, with decompression + parsing at a median 270MB/s per core on an M4 — while many binary formats top out around 500MB/s anyway, so compression is mandatory regardless. On the browser side, options are limited: direct casting is unsafe, struct-type solutions too custom, XML effectively dead, and protobuf/msgpack workable but complex. A reproducible benchmark gist is included.

Original post →

More from Infra

Infra channel →