3 ms·
> In principle it could be possible to implement a gRPC serializer FWIW it isn't that much work to rig up a C++ gRPC implementation that just does whatever you
by jeffbee 3y ago
> In principle it could be possible to implement a gRPC serializer
FWIW it isn't that much work to rig up a C++ gRPC implementation that just does whatever you want with some buffers. That is, you provide SerializationTraits for your type, and you provide the function that converts your type to what is the functional equivalent of an iovec. This helps minimize copies because, as in your example, it's often useful to add a preamble to some large byte buffer. Doing so in a naive codelab style with the vanilla protobuf API would result in extra copies, probably. However I also note that recent releases of protobuf C++ allow bytes fields to be represented by an absl::Cord, which enabled you to refer to existing large buffers instead of copying them. In either case you need a pointer that can be sent with `sendmsg`, not `sendfile`
- ithkuil 3y agoYeah I was talking about an API that would expose the file descriptors so you could use sendfile.