#note improve the description
Allocating and freeing objects with high frequency can be relatively expensive.
A common technique for improving performance is re-using memory.
sync.Pool
is a thread-safe cache for re-using allocations.
https://codeeval.dev/gist/bdf433fe2a19710909938b4e4f883882
As with all performance optimization techniques you should not over-use sync.Pool
.