Geek Culture
Published in

Geek Culture

Explore Go sync.Pool as Cache

Details about sync.Pool and ideas about using it efficiently

From unsplash, @Joshua J. Cotten

I was hit on the head by an “apple” when I was busy working in the JSON third-party library orchard.

sync.Poolis used by so many libs as a cache to improve performance, for example, go-json stores a sliceHeader via sync.Pool in case reuse is needed when decoding JSON. Why don’t I apply…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store