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 estimates makes allocation-heavy programs up to 1% faster.
The Go team has described a runtime change shipping in Go 1.27 that speeds up allocation of small objects. Instead of sending every request through the general allocation routine, the runtime now has specialised functions for each size class and pointer/no-pointer combination, up to 80 bytes.
According to the Go blog, these functions can be 20-30% faster than the generic path, and the overall effect on allocation-heavy programs is up to 1%. The specialised code can make assumptions that the general routine cannot, such as how memory is cleared, and it falls back to the generic path in uncommon cases like an active garbage collection cycle.
The team explains why the limit is 80 bytes. Each extra specialised function adds to binary size and takes space in the instruction cache, which can cancel out the gains. Benchmarks at different size classes showed that stopping at 80 bytes was the best trade-off. To keep the variants from drifting apart, they are generated from shared code with a tool built on the go/ast package.
Most Go developers do not need to change anything: the improvement applies after upgrading to Go 1.27. Teams that profile allocation-heavy services may want to re-run their benchmarks on the new release to see the effect.
Sources
Verified Oct 24, 2026 (official source). goperformanceruntime