lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Bulat Ziganshin <bulat.ziganshin <at> gmail.com> writes:

> 
> Hello David,
> 
> Wednesday, August 12, 2009, 8:08:16 AM, you wrote:
> 
> > I had tried protocol buffers before, but it seemed somewhat bulky for
> > what it did (added 1 MB to the binary I think).  It looks like they
> 
> i don't used it but docs mention that generated code may be optimized
> for speed or code size by adding directive to proto file

This is true, but unrelated.  The setting you are referring to affects the
C++ classes that the proto compiler generates for each .proto type you
want to parse.  The 1MB that David is referring to is the core libprotobuf
library, which you link in in *addition* to any specific message classes.

In other words, the 1MB is overhead, while the "optimize_for" setting
controls how large the per-message generated code is (which is added
to the 1MB core library).

libprotobuf-lite is something like 90kb, but then you have to link in
the per-message code which you can optimize for either speed or size.
And you lose the ability to load .proto types at runtime.

Josh