17.7 sync.Pool: Reusing Allocated Objects
Right, sync.Pool. This is where we graduate from “safe concurrency” to “performant concurrency.” You use a Mutex to protect access; you use a Pool to avoid the access in the first place. It’s a free-list of allocated objects that you can dip into to drastically reduce pressure on the garbage collector. The key insight is that sometimes, the most efficient way to manage memory is to not let the runtime manage it at all for certain, high-churn objects.