Hello there everybody,

I'm currently working on a system in which we have several components 
communicating with each other via gRPC/Protobuf.

My team has been doing some benchmarks and realized there's room for 
improvement in this regard (improvements that we actually need), as we 
noticed that we spend a lot of time encoding and decoding Protobuf message 
(more specifically, we work in Scala and we use ScalaPB 
<https://github.com/scalapb/ScalaPB> to generate code for our system).

We have been evaluating the idea of switching to a different serialization 
format that minimizes copies, like Cap'n'Proto, FlatBuffers or SBE.

Doing some research on this formats, it appears to me that we can probably 
achieve something similar by having a custom Protobuf codegen that 
disallows mutations (we are not mutating Protobuf as objects in our system 
anyhow, so that's fine with us) and acts as a view over the serialized 
Protobuf messages.

I proposed the idea to a couple of colleagues and at least it doesn't seem 
completely crazy, although a colleague correctly pointed out to me that 
even if we wouldn't have to perform copying, we would still have to perform 
some form of indexing to allow consumers to quickly read nested and/or 
variable length fields off of the serialized messages (maybe in a lazy and 
possibly incremental fashion), which could turn out to be more costly than 
just copying data.

The main advantage in retaining Protobuf as the encoding format is that we 
would need anyhow to still provide it as an alternative for existing users, 
and having to maintain two encoding formats could increase the complexity 
and/or represent an obstacle.

Does this idea check out with you? Is there some built-in capability and/or 
prior art that we are missing?

Thank you so much in advance for any feedback.

-- 
This message, and any attachments, is for the intended recipient(s) only, 
may contain information that is privileged, confidential and/or proprietary 
and subject to important terms and conditions available at 
http://www.digitalasset.com/emaildisclaimer.html 
<http://www.digitalasset.com/emaildisclaimer.html>. If you are not the 
intended recipient, please delete this message.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/e2493012-7f43-4876-a99f-1501fef9ce3bn%40googlegroups.com.

Reply via email to