Skip to content

[ISSUE #9553] Improve performance by avoiding repeated get(key)#9554

Merged
RongtongJin merged 2 commits intoapache:developfrom
yx9o:dev-9553
Jul 20, 2025
Merged

[ISSUE #9553] Improve performance by avoiding repeated get(key)#9554
RongtongJin merged 2 commits intoapache:developfrom
yx9o:dev-9553

Conversation

@yx9o
Copy link
Copy Markdown
Contributor

@yx9o yx9o commented Jul 17, 2025

Fixes #9553 .

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.03%. Comparing base (9c1ca2a) to head (730526f).
⚠️ Report is 6 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hill007299 hill007299 requested a review from RongtongJin July 18, 2025 06:35
groups.addAll(this.topicGroupTable.get(topic));
}
return groups;
return new HashSet<>(Optional.ofNullable(topicGroupTable.get(topic)).orElse(new HashSet<>()));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new HashSet<>(Optional.ofNullable(topicGroupTable.get(topic)).orElseGet(HashSet::new));
lazy instantiation of the new HashSet would be better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, it has been updated, please review again.

@RongtongJin RongtongJin merged commit 40e3aa9 into apache:develop Jul 20, 2025
10 of 13 checks passed
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)
@yx9o yx9o deleted the dev-9553 branch July 20, 2025 04:12
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Improve performance by avoiding repeated get(key)

3 participants