Skip to content

Instantly share code, notes, and snippets.

@rkravchik
Created February 22, 2018 12:40
Show Gist options
  • Save rkravchik/cb2a12bc73c7d63b8663bae1f9e6b566 to your computer and use it in GitHub Desktop.
Save rkravchik/cb2a12bc73c7d63b8663bae1f9e6b566 to your computer and use it in GitHub Desktop.
sync.Pool main destination
https://github.com/golang/go/issues/8232#issuecomment-66096118
Put another way, sync.Pool is for answering the question "how do I decide when to drop
this cached thing that otherwise would never die". The suggestion here is to use it to
answer the question "how can I make this thing fast". That's a mistake, even if the
implementation can satisfy both today. If it starts getting used for these two different
things, then we will not be able to change it, because optimizing for one case will hurt
the other.
Russ Cox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment