Merge branch 'develop'

This commit is contained in:
andy pan 2018-07-02 14:17:42 +08:00
commit a8314f5774
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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)