OBSERVABILITY Signal 239 2 feeds carried it
Go 1.27 JSON v2 unmarshals faster, but typed marshalling is 1.5x slower
Go 1.27's new encoding/json/v2 package and reimplemented legacy API change performance: unmarshalling is faster across the board, but marshalling typed structs is about 1.5x slower than the original implementation.
For Go developers, upgrading to Go 1.27 changes JSON performance without code changes: the legacy API on the new backend speeds up marshalling for generic data but slows down typed struct marshalling. The new v2 API offers larger gains for unmarshalling but is not a drop-in replacement due to differences in Unicode validation and case sensitivity. Teams need to benchmark their specific workloads before switching.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
encoding/json/v2 unmarshals 1.5x to 2.3x faster and marshals 1.2x to 3x faster than the original implementation.
The legacy API reimplemented on the new backend speeds up marshalling for generic data but slows down unmarshalling on canada.json.
For typed structs, marshalling with the new API is about 1.5x slower than the original implementation.
THE CLUSTER
↗