I've been investigating c++ serialization frameworks will small footprint and good performance. I've found this thread
c++ network serialization
which basically suggest to use the lite version of protocol buffers. It is not clear from this page what are the specific features of the lite version
my question is; what features do you lose when sticking to protocol buffers lite?
What are protocol buffers? Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.
Proto3 is the latest version of Protocol Buffers and includes the following changes from proto2: Field presence, also known as hasField , is removed by default for primitive fields. An unset primitive field has a language-defined default value.
In particular, it was designed to be smaller and faster than XML. Protocol Buffers are widely used at Google for storing and interchanging all kinds of structured information. The method serves as a basis for a custom remote procedure call (RPC) system that is used for nearly all inter-machine communication at Google.
protoc compiler If you don't have it already, you need to install the protobuf compiler protoc , version 3.5. 0+ (the newer the better) for the current gRPC version.
The "lite" version is not able to serialize to or from "iostream
, orFileDescriptor
", and it cannot use the Reflection
feature (although it does use refection), and... a scattering of other features.
My advice is to just use the lite version until you come across a feature that requires the full version. It is very easy to switch from one to the other.
If you need to see a list of what the lite version lacks, I recommend browsing <google/protobuf/message.h>
. Basically everything in that include file is exclusive to the full version. (<google/protobuf/message_lite.h>
is #include
d from the full version.) Here's a link: https://github.com/google/protobuf/blob/master/src/google/protobuf/message.h
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With