jiafu1115 commented on PR #20842:
URL: https://github.com/apache/kafka/pull/20842#issuecomment-3507756076

   Attach the test result:
   Send the same message to the same topic
   
   ```
   //No preload metadata
   long startTime = System.currentTimeMillis();
   Future<RecordMetadata> future = producer.send(record);
   System.out.println("take " + (System.currentTimeMillis() - startTime ) + 
"ms" );
   ```
   
   take 3053ms
   
   ```
   //Preload the metadata
   long startTime = System.currentTimeMillis();
   producer.partitionsFor(topic);
   System.out.println("take " + (System.currentTimeMillis() - startTime ) + "ms 
to warmup" );
   startTime = System.currentTimeMillis();
   Future<RecordMetadata> future = producer.send(record);
   System.out.println("take " + (System.currentTimeMillis() - startTime ) + "ms 
to sent" );
   ```
   take 3137ms to warmup
   take 46ms to sent
   


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