From 86cea41d7e2f790e0129c336376b9f2dc41b5ef8 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sun, 15 Jul 2018 23:11:05 +0800 Subject: [PATCH 1/2] optimization for codecov --- .travis.yml | 2 +- ants_benchmark_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9c67cfc..d0d41d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: - go get -t -v ./... script: - - go test -race -coverprofile=coverage.txt -covermode=atomic + - go test -race -coverprofile=coverage.txt -covermode=atomic -v # - go test -bench=. -benchmem=true -run=none ./... after_success: diff --git a/ants_benchmark_test.go b/ants_benchmark_test.go index 440a3c8..5ff6d1a 100644 --- a/ants_benchmark_test.go +++ b/ants_benchmark_test.go @@ -43,8 +43,8 @@ const ( ) const ( RunTimes = 10000000 - Param = 10 - AntsSize = 50000 + Param = 100 + AntsSize = 10000 ) func demoFunc() error { From 68d55de6f8d010138c18477be2ed8759e481d07c Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sun, 15 Jul 2018 23:34:12 +0800 Subject: [PATCH 2/2] update --- ants_benchmark_test.go | 2 +- ants_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ants_benchmark_test.go b/ants_benchmark_test.go index 5ff6d1a..0374d8a 100644 --- a/ants_benchmark_test.go +++ b/ants_benchmark_test.go @@ -44,7 +44,7 @@ const ( const ( RunTimes = 10000000 Param = 100 - AntsSize = 10000 + AntsSize = 500 ) func demoFunc() error { diff --git a/ants_test.go b/ants_test.go index 72250b4..297ddd3 100644 --- a/ants_test.go +++ b/ants_test.go @@ -47,6 +47,7 @@ func TestAntsPoolWithFunc(t *testing.T) { } wg.Wait() + t.Logf("pool with func, running workers number:%d", p.Running()) mem := runtime.MemStats{} runtime.ReadMemStats(&mem) t.Logf("memory usage:%d", mem.TotalAlloc/GiB)