Today I learned that choosing a faster data format than JSON isn’t always the performance win it seems—especially for typical web and mobile apps.
There are great alternatives out there:
MessagePack— compact binary JSONProtocol Buffers— strict schema, ultra-fastAvro— great for streamingCBOR— IoT-focused, binaryFlatBuffers— crazy fast, zero-copy
On paper, they can outperform JSON and reduce payload size significantly.
In practice? Most modern APIs don’t see meaningful gains from switching.
Here’s why.
1. JSON + gzip is already extremely small
A 20–30 KB JSON often becomes just 4–8 KB under gzip or Brotli.
Binary formats may reduce raw size, but after compression the difference is tiny.
2. JSON.parse() is insanely fast
V8’s JSON parser is written in optimized C++ and heavily tuned over years.
For small/medium payloads, alternative binary decoders may even be slower.
3. Tooling expects JSON
Switching formats breaks:
- browser devtools preview
- GraphQL Playground / GraphiQL
- React Native debugging
- Logging & monitoring pipelines
You end up adding fallback layers → more complexity.
4. The “5× faster API” dream rarely comes from encoding
Real-world API latency comes from:
- network round trips
- server logic
- database queries
- cold starts
- I/O waits
Swapping JSON for a binary format barely moves the needle.
So when is it worth it?
Use binary formats only if you have:
- 100KB+ payloads
- real-time streaming
- game engines
- IoT devices
- millions of requests per second
For typical REST/GraphQL payloads (20–30 KB), it’s usually over-engineering.
Better optimizations instead
- Enable
gzip/Brotli - Use
HTTP/2orHTTP/3 - Minimize fields (avoid over-fetching)
- Apply persistent queries for GraphQL
- Add server or CDN-level caching
These give actual 2–5× improvements with minimal risk.
Conclusion
TIL that JSON alternatives are powerful—but for most web and mobile apps, switching to MessagePack or Protocol Buffers won’t magically boost performance. JSON remains the most practical choice unless you have extreme scale or highly specialized needs.
Sometimes, simplicity wins.
Sometimes, “faster” formats are just… over-engineering.
#TIL - `Fast JSON` Alternatives Exist — But Often They’re `Over-Engineering`
Binary formats like MessagePack and Protocol Buffers promise smaller payloads and faster APIs — but for most web and mobile workloads, they offer little real-world benefit. Today I learned why switching away from JSON can easily become unnecessary complexity.