lamberken commented on a change in pull request #10469:
URL: https://github.com/apache/kafka/pull/10469#discussion_r610562341



##########
File path: tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java
##########
@@ -127,15 +122,22 @@ public static void main(String[] args) throws Exception {
             int currentTransactionSize = 0;
             long transactionStartTime = 0;
             for (long i = 0; i < numRecords; i++) {
+
+                if (payloadFilePath != null) {
+                    payload = 
payloadByteList.get(random.nextInt(payloadByteList.size()));
+                } else if (recordSize != null) {
+                    payload = new byte[recordSize];

Review comment:
       > generate quite a lot of garbage
   
   really? why it can generate a lot of garbage? you can put some gc log.
   
   > allocate payload once outside the loop 
   
   the payload always same.




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

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


Reply via email to