forked from mirror/ants
Update READMEs
This commit is contained in:
parent
66350c88db
commit
0efbda3f68
16
README.md
16
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
|
||||
|
||||
<div align="center"><img src="https://user-images.githubusercontent.com/7496278/51515466-c7ce9e00-1e4e-11e9-89c4-bd3785b3c667.png"/></div>
|
||||
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)**
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ A goroutine pool for Go
|
|||
|
||||
## 功能:
|
||||
|
||||
- 实现了自动调度并发的 goroutine,复用 goroutine
|
||||
- 定时清理过期的 goroutine,进一步节省资源
|
||||
- 自动调度海量的 goroutines,复用 goroutines
|
||||
- 定时清理过期的 goroutines,进一步节省资源
|
||||
- 提供了友好的接口:任务提交、获取运行中的协程数量、动态调整协程池大小
|
||||
- 优雅处理 panic,防止程序崩溃
|
||||
- 资源复用,极大节省内存使用量;在大规模批量并发任务场景下比原生 goroutine 并发具有更高的性能
|
||||
|
|
Loading…
Reference in New Issue