showuon opened a new pull request #11370: URL: https://github.com/apache/kafka/pull/11370
In https://github.com/apache/kafka/pull/7212, we reverted the change to use `TreeMap` instead of `ConcurrentSkipListMap`, but we forgot to remove the `size` computing codes. Also, I found the `putAll` method might be time-consuming because the method itself is not locked, but it calls a locked method inside a loop. That is, if we elements we put has 1M elements, we might do lock and unlock for 1M times. Although the JVM "might" do "lock coarsening" for us, it'd better we make sure it works as what we expected. ### 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org