πππ ants is a high-performance and low-cost goroutine pool in Go./ ants ζ―δΈδΈͺι«ζ§θ½δΈδ½ζθη goroutine ζ± γ
retrieveWorker
to make it more readable (#295)Release()
(#287)Full Changelog: https://github.com/panjf2000/ants/compare/v2.8.0...v2.9.0
In version v2.9.0, ants
introduces two new pool types: MultiPool
and MultiPoolWithFunc
from which you will benefit the
performance improvement on the basis of the fine-grained locking that reduces the lock contention.
These two pools are a good fit for the scenario where you have a large number of tasks to submit, and you don't want the single pool to be the bottleneck.
goos: darwin
goarch: arm64
pkg: github.com/panjf2000/ants/v2
BenchmarkAntsPool-10 2 777222500 ns/op 25458216 B/op 1115895 allocs/op
BenchmarkAntsMultiPool-10 2 667141666 ns/op 23590496 B/op 1105121 allocs/op
BenchmarkAntsPoolThroughput-10 2 747288979 ns/op 9266236 B/op 117693 allocs/op
BenchmarkAntsMultiPoolThroughput-10 2 579771771 ns/op 4550356 B/op 66303 allocs/op
BenchmarkParallelAntsPoolThroughput-10 1405256 801.3 ns/op 9 B/op 0 allocs/op
BenchmarkParallelAntsMultiPoolThroughput-10 2264618 473.6 ns/op 9 B/op 0 allocs/op
Thanks to all these contributors: @ELchem, @POABOB and @panjf2000 for making this release possible.
ReleaseTimeout
for the default pool (#285)ReleaseTimeout
for the default pool (#285)Full Changelog: https://github.com/panjf2000/ants/compare/v2.7.0...v2.8.0
Thanks to all these contributors: @ELchem, @GlebRadchenko, @gocurr, @panjf2000 and @piaodazhu for making this release possible.
goos: darwin
goarch: arm64
pkg: github.com/panjf2000/ants/v2
name old time/op new time/op delta
AntsPool-10 771ms Β± 9% 669ms Β± 6% -13.29% (p=0.000 n=10+10)
name old alloc/op new alloc/op delta
AntsPool-10 23.0MB Β± 5% 23.0MB Β± 4% ~ (p=0.968 n=10+9)
name old allocs/op new allocs/op delta
AntsPool-10 1.10M Β± 1% 1.10M Β± 1% ~ (p=0.182 n=10+9)
Full Changelog: https://github.com/panjf2000/ants/compare/v2.6.0...v2.7.0
Thanks to all these contributors: @panjf2000 for making this release possible.