alex-plekhanov commented on code in PR #13296:
URL: https://github.com/apache/ignite/pull/13296#discussion_r3511083811
##########
modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java:
##########
@@ -464,24 +479,28 @@ private void
writeCompressedMessage(Consumer<DirectMessageWriter> consumer, bool
}
if (!stream.serializeFinished()) {
- ByteBuffer tmpBuf = ByteBuffer.allocateDirect(TMP_BUF_CAPACITY);
+ // Scratch buffer is only copied into a heap array by
CompressedMessage before deflating, so a heap
+ // buffer is strictly cheaper than a direct one (no native alloc /
Cleaner churn) on this per-field path.
+ ByteBuffer tmpBuf = ByteBuffer.allocate(TMP_BUF_CAPACITY);
Review Comment:
Now, when we have heap buffer, maybe it worth to use `buf.array()` in
`CompressedMessage.compress()` instead of array copy?
--
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]