Remove protective copies in Thrift APIs#6457
Conversation
Generate thrift with unsafe_binaries flag to remove unwanted protective copies of ByteBuffer types (we will copy as needed ourselves).
|
There are a few other options we may want to look at for performance, too. In particular, the thrift -help 2>&1 | sed -n '/^\s\sjava\s/,/^\s\s\w/p' |
|
These changes look good |
DomGarguilo
left a comment
There was a problem hiding this comment.
LGTM as long as it addresses the issue outlined in #6455
|
So, these changes look good, but there is still an issue. Take this code for example: The code before #6430 looked like: The code in #6430 made the members private, so when accessing The changes in this PR only removes the defensive copy from |
dlmarion
left a comment
There was a problem hiding this comment.
Either the code calling the Thrift objects needs to be checked / corrected, or maybe some other Thrift compilation flag needs to be used so that copies are not made in the getX methods.
|
I'm abandoning this change. I don't think it's a good idea anymore for the following reasons:
We can continue the discussion on #6455 for possible next steps. |
Generate thrift with unsafe_binaries flag to remove unwanted protective copies of ByteBuffer types (we will copy as needed ourselves).