sodonnel commented on PR #5376:
URL: https://github.com/apache/ozone/pull/5376#issuecomment-1742837270
In looking at this, I checked:
```
public static OMRequest convertByteStringToOMRequest(ByteString byteString)
throws InvalidProtocolBufferException {
byte[] bytes = byteString.toByteArray();
return OMRequest.parseFrom(bytes);
}
```
And I noticed it takes the passed byteString and converts it to Bytes and
then passes the bytes to `OMRequest.parseFrom()`. OMRequest.parseFrom also
accepts a ByteString as a parameter, avoiding this copy - however, the
parameter to this method is
`org.apache.ratis.thirdparty.com.google.protobuf.ByteString;` and the parameter
in the method is `com.google.protobuf.ByteString`.
I don't know much about how this Ratis stuff is put together, but it seems
that we are paying the price for an extra copy on every message received due to
"different" but likely the same classes being used behind the scenes.
--
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]