lintianzhi opened a new issue, #2229: URL: https://github.com/apache/brpc/issues/2229
**Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)** 在bthread任务创建非常频繁的情况下提高性能 **Describe the solution you'd like (描述你期望的解决方法)** 当前在做task steal的时候,每次只会拿一个任务。在任务创建非常频繁的时候,task steal的原子操作也会成为瓶颈,可以通过一次多拿一些任务来降低这部分的竞争 **Describe alternatives you've considered (描述你想到的折衷方案)** 修改`WorkStealingQueue`的[steal](https://github.com/apache/brpc/blob/master/src/bthread/work_stealing_queue.h#L117)函数,使一次可以获取多一些任务,任务数量为 `min(MAX_STEAL_SIZE, queue_size/4)` - 我测试的条件设置了`MAX_STEAL_SIZE=8` **Additional context/screenshots (更多上下文/截图)** 在我这边的的使用场景里面,测试了当CPU跑到60%+的时候,性能优化有10%以上 然后因为限制了只有剩余任务大于8个才会steal超过1个的任务,在CPU不高的时候响应时间也不会比之前的版本差 希望可以考虑测试调整这部分的调度逻辑 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
