go-github-com-libp2p-go-buffer-pool 0.1.0
Channel: guix
Home page: https://github.com/libp2p/go-buffer-pool
Synopsis: Variable size buffer pool for Golang
Description:
This package provides a variable size buffer pool for Golang.
go-buffer-pool
provides:
BufferPool
: A pool for re-using byte slices of varied sizes. This pool will always return a slice with at least the size requested and a capacity up to the next power of two. Each size class is pooled independently which makes theBufferPool
more space efficient than a plainsync.Pool
when used in situations where data size may vary over an arbitrary range.Buffer
: a buffer compatible withbytes.Buffer
but backed by aBufferPool
. Unlikebytes.Buffer
,Buffer
will automatically shrink on read, using the buffer pool to avoid causing too much work for the allocator. This is primarily useful for long lived buffers that usually sit empty.
Total results: 1