News for hackers. Stuff that matters.
Re:Simple techniques to optimise Go programs by sjwhitworth on Tuesday June 18, 2019 @12:09PM (#20214650)
There's a little at the bottom that encourages caution. In a previous draft, I wrote about the importance of proving hot spots before optimising, but took it out as I wanted this to be more a list of techniques.

On sync.Pool: good spot. I'll update it - thanks.

Re:Simple techniques to optimise Go programs by stebalien on Tuesday June 18, 2019 @04:29PM (#20218050)
Unfortunately, that's still wrong (I think). Go will still allocate a temporary slice-header on the heap and then de-allocate it when it's dereferenced.

I believe the only way to do this without unsafe code is to pool these slice-headers as in https://github.com/libp2p/go-buffer-pool/blob/master/pool.go.