From 0efbda3f68b0a3aab80168037c2e18c5be081014 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Wed, 9 Oct 2019 19:42:32 +0800 Subject: [PATCH] Update READMEs --- README.md | 16 ++++++++-------- README_ZH.md | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9957239..aa2a990 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,12 @@ Library `ants` implements a goroutine pool with fixed capacity, managing and rec ## Features: -- Automatically managing and recycling a massive number of goroutines. -- Periodically purging overdue goroutines. -- Friendly interfaces: submitting tasks, getting the number of running goroutines, tuning capacity of pool dynamically, closing pool. -- Handle panic gracefully to prevent programs from crash. -- Efficient in memory usage and it even achieves higher performance than unlimited goroutines in golang. -- Nonblocking mechanism. +- Managing and recycling a massive number of goroutines automatically +- Purging overdue goroutines periodically +- Friendly interfaces: submitting tasks, getting the number of running goroutines, tuning capacity of pool dynamically, closing pool +- Handle panic gracefully to prevent programs from crash +- Efficient in memory usage and it even achieves higher performance than unlimited goroutines in Golang +- Nonblocking mechanism ## Tested in the following Golang versions: @@ -295,7 +295,7 @@ All tasks submitted to `ants` pool will not be guaranteed to be addressed in ord ## Benchmarks
- In this benchmark-picture, the first and second benchmarks performed test cases with 1M tasks and the rest of benchmarks performed test cases with 10M tasks, both in unlimited goroutines and `ants` pool, and the capacity of this `ants` goroutine-pool was limited to 50K. + In this benchmark result, the first and second benchmarks performed test cases with 1M tasks and the rest of benchmarks performed test cases with 10M tasks, both in unlimited goroutines and `ants` pool, and the capacity of this `ants` goroutine-pool was limited to 50K. - BenchmarkGoroutine-4 represents the benchmarks with unlimited goroutines in golang. @@ -305,7 +305,7 @@ All tasks submitted to `ants` pool will not be guaranteed to be addressed in ord ![](https://user-images.githubusercontent.com/7496278/51515499-f187c500-1e4e-11e9-80e5-3df8f94fa70f.png) -In above benchmark picture, the first and second benchmarks performed test cases with 1M tasks and the rest of benchmarks performed test cases with 10M tasks, both in unlimited goroutines and `ants` pool, and the capacity of this `ants` goroutine-pool was limited to 50K. +In above benchmark result, the first and second benchmarks performed test cases with 1M tasks and the rest of benchmarks performed test cases with 10M tasks, both in unlimited goroutines and `ants` pool, and the capacity of this `ants` goroutine-pool was limited to 50K. **As you can see, `ants` performs 2 times faster than goroutines without pool (10M tasks) and it only consumes half the memory comparing with goroutines without pool. (both in 1M and 10M tasks)** diff --git a/README_ZH.md b/README_ZH.md index 0da101a..c3ae407 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -20,8 +20,8 @@ A goroutine pool for Go ## 功能: -- 实现了自动调度并发的 goroutine,复用 goroutine -- 定时清理过期的 goroutine,进一步节省资源 +- 自动调度海量的 goroutines,复用 goroutines +- 定时清理过期的 goroutines,进一步节省资源 - 提供了友好的接口:任务提交、获取运行中的协程数量、动态调整协程池大小 - 优雅处理 panic,防止程序崩溃 - 资源复用,极大节省内存使用量;在大规模批量并发任务场景下比原生 goroutine 并发具有更高的性能