mirror of https://github.com/panjf2000/ants.git
Merge branch 'develop'
This commit is contained in:
commit
a8314f5774
|
@ -176,7 +176,7 @@ Memory : 8 GB 1867 MHz DDR3
|
|||
|
||||
**从该demo测试吞吐性能对比可以看出,使用ants的吞吐性能相较于原生goroutine可以保持在2-6倍的性能压制,而内存消耗则可以达到10-20倍的节省优势。**
|
||||
|
||||
[1]: https://travis-ci.com/panjf2000/ants.svg?branch=master
|
||||
[1]: https://travis-ci.com/panjf2000/ants.svg?branch=develop
|
||||
[2]: https://travis-ci.com/panjf2000/ants
|
||||
[3]: https://godoc.org/github.com/panjf2000/ants?status.svg
|
||||
[4]: https://godoc.org/github.com/panjf2000/ants
|
||||
|
|
|
@ -47,6 +47,8 @@ func demoFunc() error {
|
|||
}
|
||||
|
||||
func main() {
|
||||
defer ants.Release()
|
||||
|
||||
runTimes := 1000
|
||||
|
||||
// use the common pool
|
||||
|
@ -70,6 +72,7 @@ func main() {
|
|||
wg.Done()
|
||||
return nil
|
||||
})
|
||||
defer p.Release()
|
||||
// submit tasks
|
||||
for i := 0; i < runTimes; i++ {
|
||||
wg.Add(1)
|
||||
|
|
Loading…
Reference in New Issue