A common “selling point” I see in a lot of Go libraries is “zero allocations”. It’s clear from these results that this doesn’t automatically mean better in every scenario.
Zero allocations is probably a silly goal and obviously there are many other considerations but reducing allocations in a hot path can definitely help as it takes pressure off the garbage collector and means you have less churn. It is good that they point out here zero allocations is not equal to automatically faster though.
Zero allocations is probably a silly goal and obviously there are many other considerations but reducing allocations in a hot path can definitely help as it takes pressure off the garbage collector and means you have less churn. It is good that they point out here zero allocations is not equal to automatically faster though.