The code seems reasonable, but I'm wondering of the need. Do you actually see refc binary leakage? I could maybe see that happen if you have long lived connections, from which you subtract a smallish portion of the binary from a much larger thrift object and pass it around, but I'm not totally certain. Is there a case where you are actually seeing this leakage occuring? @k32 Have you checked out https://github.com/openx/ox-thrift which @dhull wrote? It uses the ranch acceptor pool instead of the standard server and is a complete rewrite of the message encoding/decoding. It's about 5-10x faster at encoding/decoding, so it's an improvement. The only way to make it faster would be to rewrite the compiler which @dhull has looked at but not done (the idea would be to generate a custom module for encoding/decoding instead of the generic structures which then get interpreted, this should lead to even more efficiency as you'd not have to go through an intermediate representation). An yway, maybe David will take a look at this, but I think it's probably fine to merge. My only real comment would be that this appears to make the default copying the binaries, which could be a surprise if people aren't expecting it and are moving large thrift structures around. So it might be worthwhile to document that somewhere, not sure where though.
[ Full content available at: https://github.com/apache/thrift/pull/1585 ] This message was relayed via gitbox.apache.org for [email protected]
