liyafan82 commented on a change in pull request #7071:
URL: https://github.com/apache/arrow/pull/7071#discussion_r417912784



##########
File path: 
java/vector/src/main/java/org/apache/arrow/vector/ipc/message/ArrowRecordBatch.java
##########
@@ -219,16 +218,7 @@ public long computeBodyLength() {
     for (int i = 0; i < buffers.size(); i++) {
       ArrowBuf buffer = buffers.get(i);
       ArrowBuffer layout = buffersLayout.get(i);
-      size += (layout.getOffset() - size);
-
-      long readableBytes = buffer.readableBytes();
-      while (readableBytes > 0) {
-        int nextRead = (int)Math.min(readableBytes, Integer.MAX_VALUE);
-        ByteBuffer nioBuffer =
-            buffer.nioBuffer(buffer.readerIndex(), nextRead);
-        readableBytes -= nextRead;
-        size += nioBuffer.remaining();

Review comment:
       This has significant performance overhead. 




----------------------------------------------------------------
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:
[email protected]


Reply via email to