Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

protocol buffer lite versus regular protocol buffer

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?

like image 338
lurscher Avatar asked Jun 19 '11 23:06

lurscher


People also ask

What are protocol buffers?

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.

What is the difference between proto2 and Proto3?

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.

Are protocol buffers still used?

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.

What version of protobuf does gRPC use?

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.


1 Answers

The "lite" version is not able to serialize to or from iostream, or "FileDescriptor", 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 #included from the full version.) Here's a link: https://github.com/google/protobuf/blob/master/src/google/protobuf/message.h

like image 140
karadoc Avatar answered Oct 02 '22 12:10

karadoc