Releases: diegommm/adaptivepool
Releases · diegommm/adaptivepool
v0.3.1
v0.3.0
What's Changed
- Split PoolItemProvider into ItemProvider and Estimator by @diegommm in #3
- Fix bug in ReaderBufferer always putting values as zero-sized
- Split PoolItemProvider into ItemProvider and Estimator
- ItemProvider should now return items of the specified size, and also
reset items for reuse - Change the size logic to work on capacity instead of length
- The EstimatorStats struct now allows backwards compatibility with already
written Estimator implementations - AdaptivePool: add a GetWithSize method that will get an item from the
sync.Pool and return it if it has at least the requested size, or otherwise
drop it and allocate a new object with that size instead - ReaderBufferer: allow specifying the size of the preallocated buffer
- Fix nil pointer deref
- rephrase: size -> cost
- Fix remaining references to the word size by @diegommm in #4
- README.md: Fix the usage of the word Len by @diegommm in #5
- Fix and improve docs by @diegommm in #6
Full Changelog: v0.2.0...v0.3.0
v0.2.0
v0.1.0
- Typed elements sync.Pool, with very similar API
- Allow customizing reuse of elements based on custom policies
- Allow creating new elements with appropriate preallocation
- Lock-free internal reading of statistics
- Provides two implementations of elements: one for
*bytes.Buffer
and one generic for slices, which assume a Normal Distribution - Rolling statistics implementation that keeps Mean and Standard Deviation
- Allows to bias statistics towards recent
maxN
elements to improve adaptability to seasonal changes
Results of benchmarks on rolling statistics implementation:
goos: linux
goarch: amd64
pkg: github.com/diegommm/adaptivepool
cpu: 13th Gen Intel(R) Core(TM) i7-13700H
│ - │
│ sec/op │
Stats/implem=stats1-20 94.72µ ± 6%
Full Changelog: https://github.com/diegommm/adaptivepool/commits/v0.1.0