Go 1.27 speeds up small memory allocations with size-specialized runtime functions
Allocations of 80 bytes or fewer can be 20-30% faster, which the Go team says makes allocation-heavy programs up to 1% faster.
The Go team has explained how Go 1.27 allocates small objects faster. The runtime now includes specialized allocation functions for each size class and pointer layout, used for allocations of 80 bytes or fewer. The team reports that these allocations can be 20-30% faster, and that allocation-heavy programs can gain up to 1% overall.
The post describes why the cutoff sits at 80 bytes. Each specialized function adds to the size of compiled programs and competes for instruction cache space, so the gains shrink as sizes grow. Benchmarks run at several size classes pointed to 80 bytes as the best trade-off. Where a specialized path cannot handle a case, such as while the garbage collector is active, it falls back to the general allocator.
The speedups come from simpler code paths and from clearing small blocks of memory with inline instructions instead of calling an assembly routine. The specialized functions are generated by a small tool built on the standard go/ast package, which keeps the variants consistent with each other.
Developers do not need to change code to benefit. Programs that allocate many small objects, such as parsers, servers and data structure heavy tools, are the most likely to see a difference. Teams that care about performance can compare their own benchmarks between Go 1.26 and Go 1.27 to see the effect on their workloads.
Sources
Verified Oct 25, 2026 (official source). goruntimeperformance