Skip to content

Commit

Permalink
Update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Oct 9, 2019
1 parent 66350c8 commit 0efbda3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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.

Expand All @@ -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)**

Expand Down
4 changes: 2 additions & 2 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ A goroutine pool for Go

## 功能:

- 实现了自动调度并发的 goroutine,复用 goroutine
- 定时清理过期的 goroutine,进一步节省资源
- 自动调度海量的 goroutines,复用 goroutines
- 定时清理过期的 goroutines,进一步节省资源
- 提供了友好的接口:任务提交、获取运行中的协程数量、动态调整协程池大小
- 优雅处理 panic,防止程序崩溃
- 资源复用,极大节省内存使用量;在大规模批量并发任务场景下比原生 goroutine 并发具有更高的性能
Expand Down

0 comments on commit 0efbda3

Please sign in to comment.