I'll try to get to this by the end of the week.
On Tue, Jul 28, 2009 at 9:50 PM, Kenton Varda<ken...@google.com> wrote:
> I just committed the new "lite mode" refactoring for C++ and Java to SVN.
> To use the new feature, add this line to your .proto file:
> option optimize_for = LITE_RUNTIME;
> This will cause protoc to generate code which is just as fast as with
> optimize_for = SPEED, but lacks descriptors, reflection, UnknownFieldSet,
> and features which are tied to them. This means the code can be linked
> against a much smaller subset of the protocol buffers runtime library and
> will not spend time at start-up building descriptors.
> Currently, the C++ Makefile will compile libprotobuf and libprotobuf-lite as
> independent, stand-alone libraries, even though the latter is a subset of
> the former. Is this what we want? I'm not sure. If we make libprotobuf
> depend on libprotobuf-lite, then users who want the full library will have
> to specify *both* when linking their own apps, unless we provide a
> "protobuf-config" script or something like that. Complicating things
> further, if you app does not use extensions, then extension_set.cc can be
> removed from the lite library to make it even smaller, but having three
> separate libraries just seems excessive!
> For Java, I have not yet updated the Maven POM to separate the libraries.
> I'm not sure how -- Greg, can you work on this? "Lite" messages need only
> the following classes:
> C++, as measured by the "size" command on Linux:
> libprotobuf.so: 948k
> libprotobuf-lite.so: 148k
> libprotobuf-lite.so with extension_set.cc removed: 91k
> Java, measured by totalling the sizes of the .class files:
> full library: 904k
> lite library: 120k
> I suspect we can further reduce some of these numbers with some more work.
> For instance, an extension-less Java lite library might be as much as 50k
> smaller, though will require a bit more work than simply yanking some
Data Liberation & Feedburner
Sent from Chicago, IL, United States
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to firstname.lastname@example.org
To unsubscribe from this group, send email to
For more options, visit this group at