gortiz commented on code in PR #15694:
URL: https://github.com/apache/pinot/pull/15694#discussion_r2131595629


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/GrpcSendingMailbox.java:
##########
@@ -121,12 +112,31 @@ private void sendInternal(MseBlock block, 
List<DataBuffer> serializedStats)
     if (_contentObserver == null) {
       _contentObserver = getContentObserver();
     }
-    splitAndSend(block, serializedStats);
+    processAndSend(block, serializedStats);
     if (LOGGER.isDebugEnabled()) {
       LOGGER.debug("==[GRPC SEND]== message " + block + " sent to: " + _id);
     }
   }
 
+  private void processAndSend(MseBlock block, List<DataBuffer> serializedStats)
+      throws IOException {
+    _statMap.merge(MailboxSendOperator.StatKey.RAW_MESSAGES, 1);
+    long start = System.currentTimeMillis();
+    try {
+      DataBlock dataBlock = MseBlockSerializer.toDataBlock(block, 
serializedStats);
+      int sizeInBytes = _sender.processAndSend(dataBlock);
+      if (LOGGER.isDebugEnabled()) {
+        LOGGER.debug("Serialized block: {} to {} bytes", block, sizeInBytes);

Review Comment:
   My two cents: If you know debug is enabled, as you do here, it is better to 
write the same log in the eager form:
   ```java
           LOGGER.debug("Serialized block: " + bytes + " to " + sizeInBytes + " 
bytes");
   ```
   
   instead. Static analyzers like Intellij will complain, but they are wrong. 
The format you are using (varargs) requires an array allocation (which Java's 
JIT is very bad at optimizing) while my suggestion does not.
   
   The varargs alternative has better performance than the eager one in cases 
you don't know for sure that the log will be printed because it is lazy and 
therefore the final string doesn't need to be built if the log is not printed.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to