New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
是否有必要维护workerPool? #24
Labels
Comments
不是为了限制协程数量,是为了复用协程,4c测试相比直接go func() 性能更好一些。如果你的服务cores很多,用gopool可能会引入锁开销,这个在gopool有单独的优化 |
补充一点: worker pool 有个大的优化点是避免 goroutine 的栈扩张 |
我来回复一下:
TODO:
|
solved: #28 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如果只是为了实现协程数量限制,仅维护逻辑上的workerCnt,直接使用go func()闭包就好了吧?还可以减少一次workerPool:Get/Put的开销。
The text was updated successfully, but these errors were encountered: