TLDR Tech / DevOps
Allocating on the Stack
Go 1.25 and 1.26 improve performance by allocating small slice backing arrays on the stack instead of the heap, reducing allocation and GC overhead. Even when slices escape, Go 1.26 can use a stack buffer first and move it to the heap only if needed, often cutting allocations down to one.
Read the full story