xhumanoid commented on code in PR #3769:
URL: https://github.com/apache/celeborn/pull/3769#discussion_r3718355857
##########
common/src/main/java/org/apache/celeborn/common/network/protocol/Encoders.java:
##########
Review Comment:
also can be update to remove unnecessary allocation
```
int length = buf.readInt();
// in java 8 it implemented as
// this.value = StringCoding.decode(charset, bytes, offset,
length);
// so we still have new decoded allocation inside StringCoding
// can cache decode in ThreadLocal, but it additional complexity
// in fresh java it reuses decoder instance and skips decoder
allocation
// just wait new version, current implementation is good enough for now
String s = buf.toString(buf.readerIndex(), length,
StandardCharsets.UTF_8);
buf.skipBytes(length);
return s;
```
--
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]