lhotari commented on code in PR #22494:
URL: https://github.com/apache/pulsar/pull/22494#discussion_r1562901480
##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/SimpleTextOutputStream.java:
##########
@@ -44,7 +46,8 @@ public SimpleTextOutputStream write(byte[] a, int offset, int
len) {
}
public SimpleTextOutputStream write(char c) {
- write(String.valueOf(c));
+ singleCharBuffer.put(0, c);
+ buffer.writeCharSequence(singleCharBuffer, CharsetUtil.UTF_8);
Review Comment:
This change reduces a lot of String allocations. This was visible in
allocation profiling.
--
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]