splett2 opened a new pull request #9555: URL: https://github.com/apache/kafka/pull/9555
A profile from a moderately busy cluster shows that calls to `protectedListener` can make up more than 1% of the allocations in a cluster. `config.interBrokerListenerName` is an expensive call that both makes a copy of the `KafkaConfig`'s backing map and performs string/regex parsing. Given that we call `protectedListener()` multiple times per call to `ConnectionQuotas.inc()`, we end up performing a lot of unnecessary allocations, particularly given that the inter broker listener changes very infrequently. We can instead cache the inter broker listener name, and only update it when listeners are removed/added. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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