mxsm commented on code in PR #5870:
URL: https://github.com/apache/rocketmq/pull/5870#discussion_r1067672501
##########
client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java:
##########
@@ -695,16 +695,13 @@ private SendResult sendDefaultImpl(
if (sendResult != null) {
return sendResult;
}
+ StringBuilder info = new StringBuilder(300);
+ info.append("Send [").append(times).append("] times, still failed,
cost [")
+ .append(System.currentTimeMillis() -
beginTimestampFirst).append("]ms, Topic: ").append(msg.getTopic())
+ .append(", BrokersSent: ").append(Arrays.toString(brokersSent))
+ .append(FAQUrl.suggestTodo(FAQUrl.SEND_MSG_FAILED));
Review Comment:
> It seems that the String.format is more readable here
This optimization has been done from a performance perspective. The
performance of String.format is relatively poor and triggers an array
expansion, which can be referenced in issue #5804 . However, readability has
been reduced.Performance enhancement should be considered as the first priority.
--
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]