Go Perf Encoding JSON

Guides fast JSON in Go — encoding/json's reflection and per-call allocation cost, reusing a pooled Encoder/Decoder over per-call Marshal, decoding into typed structs not map[string]any, json.RawMessage to skip subtrees, streaming with Decoder.Token, the json/v2 + jsontext Go 1.25 GOEXPERIMENT=jsonv2 experiment, and codegen libraries (easyjson, jsoniter). Fires on "json is slow", "speed up json marshaling", "reduce json allocations", "stream large json", "json/v2". Routes correctness to go-json, pooling to go-perf-sync-pool.

ctoth 7a5ab00 3 files · 32.6 KB Updated

File contents

ctoth/golang-skills-plugin/tree/main/plugins/performant-golang/skills/go-perf-encoding-json commit 7a5ab0084a

Frequently asked questions

npx skillmds@latest add ctoth/go-perf-encoding-json