https://pantsbuild.org/ logo
#development
Title
# development
a

average-vr-56795

09/29/2017, 4:41 PM
There are two big examples I've seen so far: 1. A resolved Operation's response is an Any, which has as a field a copy of the bytes of a serialised proto. So to produce one, you need to serialise the ExecutionResponse to bytes, and then copy those bytes into a proto, which you serialize as a byte-buffer that happens to contain inline an exact copy of those bytes you serialized. It sucks that you have to write those intermediate proto-bytes, and that you can't just put a pointer to the proto language-object as the value of the Any, and only serialise it once (when you're serializing the Operation). I guess that will end up actually being on the server side, so I shouldn't worry about it so much in the Rust, but I had to do it for tests and it made me sad. 2. When you need to include the digest of a proto somewhere, you need to serialise it to bytes in order to digest it. But then, when you actually end up needing to send the proto somewhere, you need to serialise it again, unless you've held on to a copy of its serialised bytes somewhere.