This commit switches the bufferpool to use the zeropool implementation for sync pools.
The stdlib sync.Pool implementation has an issue where it causes an additional heap allocation per Put() call when used with byte slices.
github.com/colega/zeropool package has been specifically designed to work around this issue, which reduces GC pressure and improves performance.
This also fixes the bufferpool's pkg benchmark to use a new pool per test, to avoid other tests influencing the behavior of the benchmark and sets it to report the allocations.
This commit switches the bufferpool to use the zeropool implementation for sync pools.
The stdlib sync.Pool implementation has an issue where it causes an additional heap allocation per Put() call when used with byte slices.
github.com/colega/zeropool package has been specifically designed to work around this issue, which reduces GC pressure and improves performance.
This also fixes the bufferpool's pkg benchmark to use a new pool per test, to avoid other tests influencing the behavior of the benchmark and sets it to report the allocations.