-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[broker] Fix inefficient forEach loop #13742
[broker] Fix inefficient forEach loop #13742
Conversation
It is similar with #12953, please take a look. @BewareMyPower @codelipenghui |
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java
Show resolved
Hide resolved
/pulsarbot rerun-failure-checks |
/pulsarbot rerun-failure-checks |
/pulsarbot rerun-failure-checks |
/pulsarbot rerun-failure-checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
7878041
to
799c991
Compare
Motivation
There are some methods implements with inefficient forEach loop, so fix it to get better performance. It is similar with #12953
Modifications
I rewrite it with
for
loop.Verifying this change
This change added tests and can be verified as follows:
org.apache.pulsar.common.util.collections.ConcurrentSortedLongPairSetTest#testIsEmpty
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below or label this PR directly (if you have committer privilege).
Need to update docs?
no-need-doc
It is a kind of
bugfix