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: AbstractMessageLite.java ByteString.java CodedInputStream.java CodedOutputStream.java ExtensionRegistryLite.java FieldSet.java GeneratedMessageLite.java InvalidProtocolBufferException.java Internal.java MessageLite.java UninitializedMessageException.java WireFormat.java *Numbers* 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 classes. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~----------~----~----~----~------~----~------~--~---