github.com/CAFxX/bytespool (go): Package bytespool implements a series of sync.Pools tailored to safely recycle byte slices and bytes.Buffers. It works by defining a number of buckets, each for slices or Buffers of a certain range of capacities, and directing the Put and Get requests to the appropriate bucket. This package is autogenerated to allow to customize the granularity of the buckets and the range of supported capacities. This version was generated with the following buckets: 256B 512B 1KB 2KB 4KB 8KB 16KB 32KB 64KB 128KB 256KB 512KB 1MB 2MB 4MB 8MB 16MB. It is advisable not to grow/extend the byte slices or bytes.Buffer returned by bytespool, as this incurs allocations. To avoid this, use bytespool to allocate a new object of the desired size, copy the data to the new object and then recycle the original object.
Keywords: buffer|bufio|bytes|garbage-collection|golang|pool