Copilot commented on code in PR #10971:
URL: https://github.com/apache/rocketmq/pull/10971#discussion_r3869318626


##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullAPIWrapper.java:
##########
@@ -128,15 +128,15 @@ public PullResult processPullResult(final MessageQueue 
mq, final PullResult pull
                 this.executeHook(filterMessageContext);
             }
 
+            String minOffset = Long.toString(pullResult.getMinOffset());
+            String maxOffset = Long.toString(pullResult.getMaxOffset());
             for (MessageExt msg : msgListFilterAgain) {

Review Comment:
   `minOffset`/`maxOffset` are now always stringified even when 
`msgListFilterAgain` becomes empty after tag filtering (or other filtering), 
which allocates 2 short-lived Strings where the previous code allocated none 
for the empty-loop case. Since this PR is a micro-optimization on a hot path, 
it’s worth avoiding any new allocations by computing these strings only when 
the list is non-empty.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to