Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make several optimizations to worker pool (#680)
* Use binary-search algorithm to speed up cleaning up workers * Speed it up when iterating the slice of workerChan * Use sync.Pool as a more canonical way * Add benchmark test between binary-search and linear search * Optimize range to the slice of workerChan, avoiding elements copy * Perfect the benchmark of work pool * Make binary-search code inline and remove benchmark test code
- Loading branch information
1 parent
f82a646
commit 9f11af2
Showing
1 changed file
with
32 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters