[ISSUE #9553] Improve performance by avoiding repeated get(key)#9554
Merged
RongtongJin merged 2 commits intoapache:developfrom Jul 20, 2025
Merged
[ISSUE #9553] Improve performance by avoiding repeated get(key)#9554RongtongJin merged 2 commits intoapache:developfrom
RongtongJin merged 2 commits intoapache:developfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #9554 +/- ##
=============================================
- Coverage 48.15% 48.03% -0.13%
+ Complexity 12070 12042 -28
=============================================
Files 1313 1313
Lines 92770 92767 -3
Branches 11862 11862
=============================================
- Hits 44677 44563 -114
- Misses 42599 42692 +93
- Partials 5494 5512 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
RongtongJin
reviewed
Jul 19, 2025
| groups.addAll(this.topicGroupTable.get(topic)); | ||
| } | ||
| return groups; | ||
| return new HashSet<>(Optional.ofNullable(topicGroupTable.get(topic)).orElse(new HashSet<>())); |
Contributor
There was a problem hiding this comment.
new HashSet<>(Optional.ofNullable(topicGroupTable.get(topic)).orElseGet(HashSet::new));
lazy instantiation of the new HashSet would be better.
Contributor
Author
There was a problem hiding this comment.
Thank you, it has been updated, please review again.
RongtongJin
approved these changes
Jul 20, 2025
zwp88
added a commit
to zwp88/rocketmq
that referenced
this pull request
Jul 20, 2025
[ISSUE apache#9553] Improve performance by avoiding repeated get(key) (apache#9554)
hechen0
pushed a commit
to hechen0/rocketmq
that referenced
this pull request
Aug 18, 2025
…apache#9554) * [ISSUE apache#9553] Improve performance by avoiding repeated get(key) * Update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9553 .