Go 1.27 speeds small heap allocations via size-specialized functions
Go 1.27 introduces specialized memory allocation functions for objects of 80 bytes or smaller, tailored to the runtime's existing size-class system. These functions handle specific size classes and pointer/non-pointer distinctions, letting the compiler skip generic branching logic used in the shared mallocgc path.
GoKawiil's interpretation of the reporting above, not reported fact.
Since small, frequent allocations are common in most Go programs, even modest per-allocation speedups compound across a program's lifetime. A reported 20-30% faster allocation time for common object sizes, yielding up to 1% overall program speedup, is a meaningful runtime-wide gain achieved without any changes required from developers.
- Go 1.27 adds specialized allocation paths for objects 80 bytes or smaller.
- Speed gains stem from letting the compiler make stronger assumptions about known size classes.
- Improvements apply automatically, boosting allocation-heavy programs by up to 1% overall.
Source: go.dev — Michael Matloob, 2026-09-17
Published there as: “Size-Specialized Memory Allocation”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.