You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/12/07 21:28:56 UTC

[GitHub] [kafka] jolshan opened a new pull request #11576: KAFKA-13512: topicIdsToNames and topicNamesToIds allocate unnecessary maps

jolshan opened a new pull request #11576:
URL: https://github.com/apache/kafka/pull/11576


   We are creating a new map unnecessarily for these methods. Remove the extra map creation and simply wrap in unmodifiable map. 
   
   I've also added a benchmark for the map method. 
   Here are some results when I limited partitions to 20 only. 
   
   Before change:
   ```
   Benchmark                                 (partitionCount)  (topicCount)  Mode  Cnt   Score   Error  Units
   MetadataRequestBenchmark.testTopicIdInfo                20           500  avgt   15  16.942 ± 0.306  ns/op
   MetadataRequestBenchmark.testTopicIdInfo                20          1000  avgt   15  19.476 ± 0.339  ns/op
   MetadataRequestBenchmark.testTopicIdInfo                20          5000  avgt   15  18.989 ± 0.482  ns/op
   ```
   
   After change:
   ```
   Benchmark                                 (partitionCount)  (topicCount)  Mode  Cnt   Score   Error  Units
   MetadataRequestBenchmark.testTopicIdInfo                20           500  avgt   15  11.120 ± 0.336  ns/op
   MetadataRequestBenchmark.testTopicIdInfo                20          1000  avgt   15  11.173 ± 0.489  ns/op
   MetadataRequestBenchmark.testTopicIdInfo                20          5000  avgt   15  11.003 ± 0.042  ns/op
   ```
   
   ### 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.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] cmccabe merged pull request #11576: KAFKA-13512: topicIdsToNames and topicNamesToIds allocate unnecessary maps

Posted by GitBox <gi...@apache.org>.
cmccabe merged pull request #11576:
URL: https://github.com/apache/kafka/pull/11576


   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] dajac commented on pull request #11576: KAFKA-13512: topicIdsToNames and topicNamesToIds allocate unnecessary maps

Posted by GitBox <gi...@apache.org>.
dajac commented on pull request #11576:
URL: https://github.com/apache/kafka/pull/11576#issuecomment-988280848


   The MetadataSnapshot is immutable so this seems fine to me as well.


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] dajac commented on pull request #11576: KAFKA-13512: topicIdsToNames and topicNamesToIds allocate unnecessary maps

Posted by GitBox <gi...@apache.org>.
dajac commented on pull request #11576:
URL: https://github.com/apache/kafka/pull/11576#issuecomment-989274136


   @cmccabe This is a blocker for 3.1. Could also merge it to the 3.1 branch please?


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org