Skip to content

Releases: panjf2000/ants

Ants v2.9.0

21 Nov 06:09
5cecad0
Compare
Choose a tag to compare

πŸš€ Features

  • feat: add MultiPool and MultiPoolWithFunc (#305)

πŸ›© Enhancements

  • opt: fall back to LeastTasks when RoundRobin can't find a worker (#306)
  • feat: add MultiPool and MultiPoolWithFunc (#305)
  • refactor: enforce a few minor optimizations in code (#302)
  • refactor: refine the code in retrieveWorker to make it more readable (#295)

πŸ› Bugfixes

  • bug: return the error from Pool.Submit/PoolWithFunc.Invoke accordingly (#297)
  • bug: fix the potential goroutine leak after calling Release() (#287)

πŸ“š Documentation

  • chore: eliminate some useless content (#303)
  • chore: update READMEs 16771ce
  • chore: add a new use case (#290)

πŸ—ƒ Misc

  • chore: eliminate some useless content (#303)
  • chore: enable more title matchers for auto-labelers of bug and new feature (#300)
  • chore: enable auto-labeler for PRs of updating semantic version (#298)
  • chore: clean up some comments and CI yaml (#296)
  • chore: bump up modules (#292)

Full Changelog: v2.8.0...v2.9.0

Performance improvement

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.

Benchmark testing

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.

Ants v2.8.0

01 Jul 13:44
1411ae8
Compare
Choose a tag to compare

πŸš€ Features

  • feat: add a new API ReleaseTimeout for the default pool (#285)

πŸ›© Enhancements

  • feat: add a new API ReleaseTimeout for the default pool (#285)
  • bug: avoid overflow when computing mid in the binarySearch of the workerStack (#278)
  • opt: refactor the worker queue for reusability and readability of code (#270)
  • opt: awake blocking goroutines more precisely in purgeStaleWorkers b32591f
  • opt: use runtime/debug.Stack() to print stack trace of panic 7a56a5c
  • opt: refactor the worker queue for reusability and readability of code 0313eff
  • opt: refine some code b6eaea1

πŸ› Bugfixes

  • bug: avoid overflow when computing mid in the binarySearch of the workerStack (#278)
  • bug: fix the missing log.Lmsgprefix in go1.13 (#275)
  • fix: exit ticktock goroutine when pool is closed (#264)

πŸ“š Documentation

🧳 Misc

  • chore: reorganize the structure of internal packages 711cad9
  • chore: reformat the default log string 3110e41

Full Changelog: v2.7.0...v2.8.0

Thanks to all these contributors: @ELchem, @GlebRadchenko, @gocurr, @panjf2000 and @piaodazhu for making this release possible.

Ants v2.7.0

11 Dec 11:56
Compare
Choose a tag to compare

Changelogs

πŸ›© Enhancements

  • opt: cache current time for workders and update it periodically (#261)

Performance improvement:

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: v2.6.0...v2.7.0

Thanks to all these contributors: @panjf2000 for making this release possible.

Ants v2.6.0

02 Nov 13:59
Compare
Choose a tag to compare

Features

Add option to turn off automatically purge (#253) b604f7d

Ants v2.5.0

07 May 15:09
Compare
Choose a tag to compare

Features

Bugfixes

  • Fix some trivial bugs

Misc

  • Add one more use case (Baidu App) 9d85d57

Ants v2.4.0

11 May 10:53
Compare
Choose a tag to compare

Features

  • Support customized logger e507ae3
  • Support unlimited pool (#90)

Bugfixes

  • Fix a bug that doesn't release lock (#79)

Misc

  • Add go1.14 support on CI
  • Leverage reviewdog as automated code review tool 77a3da4
  • Fix code issues d55cc24
  • Fix indent on README (#89)

Ants v2.3.0

02 Feb 13:19
Compare
Choose a tag to compare

Features

  • Add a feature of rebooting a released pool d32d668
  • Testing ants on multiple operating systems 73c26bc

Enhancements

  • Optimize the logic when putting worker back to sync.Pool 8cbfb5d
  • Optimize loop queue of workers 7aaa434
  • Leverage tool testify to refine unit-test code ea787e5
  • sync.Pool opt 3bfc4f2

Docs

Misc

  • Add JetBrains logo for thanks of its support 88fe6df
  • Fix a failed test on Windows temporarily 1b1fee3

Ants v2.2.0

13 Oct 17:39
Compare
Choose a tag to compare

Features

  • Support loop queue as workers queue #53

Enhancements

  • Refine the logic of sync.Pool b1cf2ff
  • Refactoring to the interface and implementations of worker-array 566511e
  • Make optimization to Pool and PoolWithFunc struct 5ecbdf4

Docs

Misc

Ants v2.1.0

27 Sep 13:10
Compare
Choose a tag to compare

Enhancements

  • Replace mutex with spin-lock e73db1d

Ants v2.0.0

26 Sep 05:59
Compare
Choose a tag to compare

Features

  • Optimize memory allocation and add the log of panic stack (#40)
  • Support nonblocking submit and max blocking limit setting (#41)
  • Add functional options pattern for ants 201ac20

Bugfixes

  • Fix a bug that blocks getting worker from pool 51c0008
  • Fix a bug where invokers get stuck in waiting idle workers af70ed0 08d01b6
  • Fix a bug that worker didn't minus the amount of running workers when it exits (#51)

Enhancements

  • Improve the process of cleaning up idle workers (#39)
  • Refactor the blocking logic in retrieveWorker function 61660e2
  • Improve the the logic of tuning the pool size and support go modules cbf8ddf

Docs

Misc

  • Support go mod 26cbd88
  • Rename the function with the more applicable name 71faec8
  • Fix some minor mistakes in test cases 9476326
  • Create CODE_OF_CONDUCT.md (#48)
  • Create pull_request_template.md 40defbb