Size-Specialized Memory Allocation
Go 1.27 adds size-specialized variants of the runtime's mallocgc for allocations of 80 bytes or fewer, one per span class (size class plus pointer/no-pointer), making these allocations 20-30% faster and allocation-heavy programs up to 1% faster. The compiler calls a specialized function directly when the size is known at compile time; otherwise mallocgc dispatches to it dynamically. Most of the gain comes from clearing memory with constant-size inline instructions instead of calling memclrNoHeapPointers, plus precomputed span classes, cheaper pointer bookkeeping and forced inlining. The functions are produced by a go/ast-based generator to keep copies in sync, and the 80-byte cutoff balances speed against binary size and instruction cache pressure. It can be disabled with GOEXPERIMENT=nosizespecializedmalloc.
Related posts
- How we tracked down a Go 1.24 memory regression across hundreds of pods
Datadog Engineering mediumAdeptUpgrading a data-processing service to Go 1.24 raised container memory by about 20% even though Go runtime metrics and heap profiles stayed flat. Comparing `/proc/[pid]/smaps` showed the Go heap's RSS had grown to nearly match its virtual size. Reproducing the workload with heapbench and running `git bisect` traced the cause to a `mallocgc` refactor. That refactor dropped an optimization that skipped re-zeroing fresh OS memory for large (>32 KiB) pointer-containing allocations, so untouched pages were committed to RAM. The fix ships in Go 1.25, and in the worst case RSS should roughly equal Go-reported virtual memory, which is useful when checking memory-limit headroom before rollout.
- Understanding Garbage Collection in JavaScriptCore From Scratch
WebKit hardMasterJavaScriptCore's garbage collector is non-compacting, generational and mostly concurrent, with heavy use of lock-free programming. The explanation starts from a naive stop-the-world generational collector and adds pieces one at a time until it reaches JSC's real design. Along the way it covers BlockDirectory-based allocators (CompleteSubspace, PreciseAllocation, IsoSubspace), why per-object metadata is split between an inlined cellState and outlined isNew/isMarked bitvectors, and how write barriers and remembered sets keep marking correct. For incremental and concurrent collection it adds remembered-set scheduling and Space-Time Scheduler mitigations, which address up to 5x memory blowup.
- 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.
- V8 release v6.9 · V8
V8 easyNoviceV8 v6.9 embeds built-in functions directly into the binary on x64, so all Isolates share one copy instead of each holding up to 700 KB on its own heap. Across the top 10k sites this cut median V8 heap size by 9%, and 10% of sites saved 3.7 MB or more. Liftoff, a new baseline WebAssembly compiler, speeds startup by over 10×. DataView methods were reimplemented in Torque and inlined by TurboFan to match TypedArray speed, and concurrent, incremental and parallel WeakMap processing roughly halves Mark-Compact GC pauses, with a linear-time fallback replacing worst cases that could take seconds. The release also adds Array.prototype.flat and flatMap.
- Speculative Optimizations for WebAssembly using Deopts and Inlining
V8 hardMasterV8 in Chrome M137 adds speculative call_indirect inlining and deoptimization support for WebAssembly, using runtime call-target feedback gathered by the Liftoff baseline compiler so TurboFan can inline up to four likely callees behind cheap instance and target checks. When an assumption fails, the Deoptimizer serializes the optimized frame into a FrameDescription, rebuilds the matching Liftoff stack frame and resumes in baseline code mid-function. This lets the optimizer drop generic slow paths that would otherwise block further optimization. The gains matter most for WasmGC languages like Dart, Java and Kotlin: over 50% average speedup on Dart microbenchmarks and 1–8% on realistic applications, with one microbenchmark dropping from 675 ms to 90 ms.