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


##########
proxy/src/main/java/org/apache/rocketmq/proxy/service/sysmessage/HeartbeatSyncer.java:
##########
@@ -131,16 +133,19 @@ public void onConsumerRegister(String consumerGroup, 
ClientChannelInfo clientCha
                     );
                     data.setSubscriptionDataSet(subList);
 
-                    log.debug("sync register heart beat. topic:{}, data:{}", 
this.getBroadcastTopicName(), data);
+                    log.debug("sync register heart beat. topic:{}, 
dataSummary:{}",
+                        this.getBroadcastTopicName(), 
summarizeHeartbeatData(data));
                     this.sendSystemMessage(data);

Review Comment:
   `summarizeHeartbeatData(data)` is evaluated eagerly even when debug logging 
is disabled, which adds avoidable overhead on the hot path of consumer register 
(it also sorts/collects topics). Wrap this debug log with 
`log.isDebugEnabled()` so the summary is only built when needed.
   
   This issue also appears in the following locations of the same file:
   - line 176
   - line 213



-- 
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