clohfink commented on code in PR #3761:
URL: https://github.com/apache/cassandra/pull/3761#discussion_r1901166470


##########
src/java/org/apache/cassandra/db/Mutation.java:
##########
@@ -448,7 +451,7 @@ private Serialization serialization(Mutation mutation, int 
version)
                     try (DataOutputBuffer dob = 
DataOutputBuffer.scratchBuffer.get())
                     {
                         serializeInternal(PartitionUpdate.serializer, 
mutation, dob, version);
-                        serialization = new 
CachedSerialization(dob.toByteArray());
+                        serialization = new 
CachedSerialization(dob.unsafeToByteArray());

Review Comment:
   if using on heap allocation can we also avoid byte array allocation here 
with buffer.array()? (buffer.hasArray()). Perhaps provide implementation of 
CachedSerialization that can use the backed array with offset/length. For 
larger mutations (ie 64kb-1mb) this can be pretty expensive still



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