The Future of JSON in Go
summary
A working V2 prototype reimplements encoding/json with a streaming json/text encoder and decoder, new variadic options to match V1 or opt into safer defaults, and new hooks like MarshalFunc/unmarshalFunc to avoid double parsing. Default V2 behavior rejects duplicate names and invalid UTF‑8; benchmarks show unmarshalling is 2.5x–8.4x faster in some cases while marshalling is roughly parity, the prototype is used in Kubernetes and Tailscale and avoids unsafe.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:10JSON improvements agenda
- 2:39JSON in Go
- 7:37Flaws in encoding/json
- 15:21Performance issues
- 17:28Security with duplicate names
- 21:26JSON V2 design
- 28:16JSON text and streaming
- 34:00V1 and V2 interoperability
- 38:57Benchmarks and results
- 41:30Next steps
related talks
07mForking Stdlib JSON
27mEvolution of serialization formats and usage in Go
33mTransition to Go 2
07mGRPC & Go
20mOptimizing Go code without a blindfold
25mRethinking Data Flow in gRPC-Go: Maximizing Memor...
42mgRPC and Go: Developing Efficient and Type-Safe Services
40mProfiling real-world golang service
