go-revolver
go-revolver copied to clipboard
Reuse artifact buffers
In networked systems that need access to fixed-size buffers, it's common to use a buffer pool to minimize allocation and relieve GC pressure. Go has sync.Pool
that's good for this purpose. It could be an over-optimization though since it's unclear if any peer would ever allocate buffers fast enough that memory actually becomes an issue.
I was looking at this code for instance.