chia7712 commented on pull request #9675: URL: https://github.com/apache/kafka/pull/9675#issuecomment-738140790
@lqjack good question! > I find the only differences is that controllerContext.allPartitions can be invoked once or the number of partition times . ```controllerContext.allPartitions``` does not return a constant value. It create a new collection and the overhead could be high if there are a lot of partitions. This PR makes ```controllerContext.allPartitions``` be called only once to reduce the cost of getting "all partitions". > does the patch can resolve the issue ? @Montyleo It seems to me the optimization of this PR is good enough. However, it would be better to show the improvement on your env by this patch. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org