A new Go API for JSON
Go 1.27 makes encoding/json/v2 and encoding/json/jsontext stable. They fix long-standing v1 flaws that the Go 1 compatibility promise prevented fixing in place: acceptance of invalid UTF-8 and duplicate object names, nil slices and maps marshaling as null, case-insensitive field matching, and inconsistent MarshalJSON calls. jsontext handles streaming, syntax-only encoding and decoding of tokens and values. v2 builds on it with per-call options, caller-specified marshalers, and streaming MarshalJSONTo/UnmarshalJSONFrom methods. Unmarshal is up to 10x faster while Marshal is roughly at parity, and switching custom unmarshalers to the streaming interfaces can yield orders-of-magnitude gains, as in Kubernetes' kube-openapi.
Related posts
- Go Turns 17
The Go Blog easyNovice
Go's 17th anniversary recap covers Go 1.26 and 1.27. On the language side, it adds generic methods, self-referential constraints, `new` with an initial value, and nested struct literal keys. In the standard library, `encoding/json/v2` reached GA with up to 10× faster unmarshaling and now backs v1, and a GC-based goroutine leak profiler shipped. Performance work includes the Green Tea GC as default (10–40% less GC overhead), experimental SIMD packages, stack-allocated append backing stores and size-specialized allocation. The release also brings post-quantum TLS/HPKE/ML-DSA, a 7.5-hour urgent response to the eMudhra weak-key incident, and tooling built for humans and AI agents: `go fix` modernizers, `//go:fix inline`, gopls MCP and the pkg.go.dev API.
- How we made JSON.stringify more than twice as fast
V8 hardMasterV8 more than doubled JSON.stringify throughput on the JetStream2 json-stringify-inspector benchmark by adding an iterative, side-effect-free fast path that skips the general serializer's defensive checks. Supporting changes include templatizing the stringifier on one-byte vs two-byte strings, SIMD and SWAR scanning for escapable characters, and a fast-json-iterable flag on hidden classes that lets keys be copied without checks. Numbers are now converted with Dragonbox instead of Grisu3, and output goes to a segmented Zone-allocated buffer to avoid realloc-and-copy. The fast path ships in V8 13.8 (Chrome 138) and applies only without replacer/space arguments, custom toJSON, indexed properties or ConsString-like strings.
- Ready, steady, goa: our API setup
incident.io mediumAdeptincident.io defines its HTTP API in Goa's design-first DSL, which generates net/http transport handlers, validation code, typed Go service interfaces, OpenAPI 3.0 specs and Go clients. This replaces hand-written Gin handlers with manual parsing, auth and serialization. On top of Goa, a `make generate-api` pipeline pretty-prints and merges the OpenAPI output and filters it into internal, mobile and public variants. Those variants feed specialised clients: typed TypeScript for the React frontend, lean mobile clients and Go test clients. A single DSL change then flows through to server code, docs and compile-time-checked frontend types.
- Bun v1.3.7
Bun mediumAdept
Bun v1.3.7 upgrades JavaScriptCore, which brings faster async/await (35%), Array.from, padStart/padEnd, array.flat and better ARM64 codegen using ccmp/ccmn chains. It also speeds up Buffer.from() with arrays by up to 50% and Buffer.swap16/swap64 by 1.8x and 3.6x through CPU intrinsics. New APIs include Bun.wrapAnsi (33–88x faster than the wrap-ansi npm package), native JSON5 parsing and imports, and Bun.JSONL with streaming parseChunk. For diagnostics there is Markdown CPU and heap profile output, --heap-prof heap snapshots and the node:inspector Profiler API. Compatibility fixes cover header case preservation in fetch, S3 presign options, bun pm pack lifecycle scripts, Indic grapheme clustering and Next.js 16 timer internals.
- Bun v1.1.23
Bun mediumAdept
Bun v1.1.23 fixes 27 bugs and adds TextEncoderStream/TextDecoderStream, the TextDecoder stream option, Float16Array, and truncation of large arrays in console.log after 100 elements. console.log(string) is 50% faster: a single-string fast path that still needed extra writes for the newline and ANSI reset was dropped in favor of buffered writes. Bun now throws proper errors instead of crashing or truncating when Blob/Request/Response bodies or fs.readFile exceed JavaScriptCore's 2^32-1 length limit. Other fixes cover duplicate sends caused by mishandled backpressure in the ws module, Bun-to-Node IPC on Windows, JIT crashes in node:vm contexts, bundler hoisting of tagged template literals, and >4GB responses from Bun.serve.