Open
Description
we should consider introducing a better buffer+reader reuse strategy (e.g. for decompressor that support Reset
ing their readers)
this would reduce memory allocation and memory pressure.
this would then reduce the amount of work needed by the garbage collector.
issues:
- as decompression/compression are tasks that greatly benefit from concurrency, we should devise a way not to limit it too drastically
- races
- for decompression, we need a mechanism to declare that a buffer is no longer in use (and a way to correctly do that)
- consider using a type-parametrized
sync.Map
as proposed in proposal: sync, sync/atomic: add PoolOf, MapOf, ValueOf golang/go#47657