PERFORMANCE Signal 427
Go 1.27 uses dedicated allocation functions for small objects under 80 bytes, nearly doubling speed
Go 1.27 replaces the generic heap allocation function with dedicated functions for objects under 80 bytes, yielding a 1.8x speedup on some small allocation benchmarks.
Programs that heavily allocate small objects on the heap, such as those maintaining dynamic trees or linked lists, could see significant performance gains. The optimization does not help code that rarely allocates on the heap or allocates larger objects.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
Go 1.27 introduces dedicated allocation functions for heap objects under 80 bytes instead of routing through a single generic function.
Benchmarking shows a 1.8x speedup for 16-byte allocations with pointers, dropping from 9.5 ns to 5.5 ns per allocation.
The improvement only benefits components performing many small heap allocations and will not affect all Go software.
THE CLUSTER
↗