You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2020/10/15 08:14:06 UTC

[GitHub] [bookkeeper] eolivelli commented on a change in pull request #2441: Protobuf should be serialized to direct memory instead of heap memory

eolivelli commented on a change in pull request #2441:
URL: https://github.com/apache/bookkeeper/pull/2441#discussion_r505318850



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java
##########
@@ -356,10 +356,10 @@ public Object encode(Object msg, ByteBufAllocator allocator) throws Exception {
 
     private static ByteBuf serializeProtobuf(MessageLite msg, ByteBufAllocator allocator) {
         int size = msg.getSerializedSize();
-        ByteBuf buf = allocator.heapBuffer(size, size);
+        ByteBuf buf = allocator.directBuffer(size, size);

Review comment:
       shall we add a comment that explains why this is better ?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org