Go Perf Allocator Internals

What a Go heap allocation costs — the ~70 size classes and rounding waste (unsafe.Sizeof vs real slot), the tiny allocator packing sub-16B pointer-free objects, the lock-free per-P mcache → mcentral → mheap hierarchy, and scannable vs noscan spans (pointer-free objects cut GC cost; "1 alloc/op" hides different costs). Fires on "still slow after removing allocs", "reduce GC pressure", "size class", "how does Go allocate". Routes to go-perf-escape-analysis, go-perf-sync-pool, go-perf-gc-tuning, go-perf-struct-layout.

ctoth f46c004 3 files · 27.6 KB Updated

File contents

ctoth/golang-skills-plugin/tree/main/plugins/performant-golang/skills/go-perf-allocator-internals commit f46c004960

Frequently asked questions

npx skillmds@latest add ctoth/go-perf-allocator-internals