Go: The Idea Behind Sync.Pool

Ali Josie
The Startup
Published in
3 min readOct 24, 2020

--

I have, recently, encountered a problem in the Go Garbage Collection inside a project of mine. A massive amount of objects were allocated repeatedly and caused a huge workload of GC. Using sync.Pool I was able to decrease the allocations and GC workload.

What is sync.Pool?

One of the highlights of the Go 1.3 release was sync Pool. It is a component under the sync package to…

--

--

Ali Josie
The Startup

Software Engineer & Information Security Enthusiast