liuzqt commented on code in PR #38064:
URL: https://github.com/apache/spark/pull/38064#discussion_r1001070001


##########
core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala:
##########
@@ -84,6 +91,57 @@ private[spark] class ChunkedByteBuffer(var chunks: 
Array[ByteBuffer]) {
     }
   }
 
+  /**
+   * write to ObjectOutput with zero copy if possible

Review Comment:
   Sorry for the confusion, the zero copy is actually "avoid extra copy". 
   - When we have access to the underlying byte array, we only need one copy: 
`underlying bytes array --> ObjectOutput`. 
   - On the other hand, when we don't have access to the underlying byte 
array(when it's off-heap), we need an extra copy: `bytes buffer --> temp buffer 
---> ObjectOutput`. 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to