From 2f0796c48dc0bb29ace1a9678eccb3a90d749e5f Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sat, 29 Sep 2018 19:47:57 +0800 Subject: [PATCH 1/4] update readme --- README.md | 4 ++-- README_ZH.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c078046..b609cca 100644 --- a/README.md +++ b/README.md @@ -182,9 +182,9 @@ There was only the test of `ants` Pool because my computer was crash when it rea **As you can see, `ants` can up to 2x~6x faster than goroutines without pool and the memory consumption is reduced by 10 to 20 times.** -[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://codecov.io/gh/panjf2000/ants/branch/master/graph/badge.svg +[3]: https://codecov.io/gh/panjf2000/ants/branch/develop/graph/badge.svg [4]: https://codecov.io/gh/panjf2000/ants [5]: https://goreportcard.com/badge/github.com/panjf2000/ants [6]: https://goreportcard.com/report/github.com/panjf2000/ants diff --git a/README_ZH.md b/README_ZH.md index e06c36e..1ba7098 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -180,9 +180,9 @@ Go1.9 **从该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://codecov.io/gh/panjf2000/ants/branch/master/graph/badge.svg +[3]: https://codecov.io/gh/panjf2000/ants/branch/develop/graph/badge.svg [4]: https://codecov.io/gh/panjf2000/ants [5]: https://goreportcard.com/badge/github.com/panjf2000/ants [6]: https://goreportcard.com/report/github.com/panjf2000/ants From 7c3c66265181779c59d1c86e4b673bb287b0b852 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Wed, 3 Oct 2018 19:11:40 +0800 Subject: [PATCH 2/4] add go1.11 into ci --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d0d41d5..dd159d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ go: - "1.8.x" - "1.9.x" - "1.10.x" + - "1.11.x" - master before_install: @@ -14,4 +15,4 @@ script: # - go test -bench=. -benchmem=true -run=none ./... after_success: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file + - bash <(curl -s https://codecov.io/bash) From 846a758f650cd1f411d5d13387a0387960f2e7b0 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sat, 1 Dec 2018 18:40:19 +0800 Subject: [PATCH 3/4] update benchmark test --- ants_benchmark_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ants_benchmark_test.go b/ants_benchmark_test.go index 416f2a7..daef33c 100644 --- a/ants_benchmark_test.go +++ b/ants_benchmark_test.go @@ -31,9 +31,9 @@ import ( ) const ( - RunTimes = 10000000 + RunTimes = 1000000 benchParam = 10 - benchAntsSize = 100000 + benchAntsSize = 200000 ) func demoFunc() error { From d052cf95e1e920fe3a4f1d7f264c92064f2d04ba Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sat, 1 Dec 2018 18:41:42 +0800 Subject: [PATCH 4/4] add some annotations --- pool.go | 2 +- pool_func.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pool.go b/pool.go index 36fe5cb..52a16f1 100644 --- a/pool.go +++ b/pool.go @@ -224,7 +224,7 @@ func (p *Pool) putWorker(worker *Worker) { worker.recycleTime = time.Now() p.lock.Lock() p.workers = append(p.workers, worker) - //通知有一个空闲的worker + // notify there is available worker p.cond.Signal() p.lock.Unlock() } diff --git a/pool_func.go b/pool_func.go index fbcbe9d..aff43cb 100644 --- a/pool_func.go +++ b/pool_func.go @@ -227,7 +227,7 @@ func (p *PoolWithFunc) putWorker(worker *WorkerWithFunc) { worker.recycleTime = time.Now() p.lock.Lock() p.workers = append(p.workers, worker) - //通知有一个空闲的worker + // notify there is available worker p.cond.Signal() p.lock.Unlock() }