ELSEIF
Your brief EB
447 stories from 199 feeds 1253 clusters Refreshed 14 minutes ago next pull 17:11

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.

WHY IT MATTERS

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 source

The three things worth knowing

01

encoding/json/v2 unmarshals 1.5x to 2.3x faster and marshals 1.2x to 3x faster than the original implementation.

02

The legacy API reimplemented on the new backend speeds up marshalling for generic data but slows down unmarshalling on canada.json.

03

For typed structs, marshalling with the new API is about 1.5x slower than the original implementation.

THE CLUSTER

Same story, 2 feeds.

ORDERED BY FIRST SEEN
Daniel Lemire's blog The new Go JSON API: twice as fast, or 1.5x slower? Open ↗
Daniel Lemire's blog via Lobsters The new Go JSON API: twice as fast, or 1.5x slower? Open ↗