Protocol Buffers - Google's data interchange format
Find a file
Thomas Van Lenten 79a23c435c Shrink ObjC overhead (generated size and some runtime sizes)
NOTE: This is a binary breaking change as structure sizes have changed size
and/or order.

- Drop capturing field options, no other options were captured and other mobile
  targeted languages don't try to capture this sort information (saved 8
  bytes for every field defined (in static data and again in field descriptor
  instance size data).
- No longer generate/compile in the messages/enums in descriptor.proto. If
  developers need it, they should generate it and compile it in. Reduced the
  overhead of the core library.
- Compute the number of has_bits actually needs to avoid over reserving.
- Let the boolean single fields store via a has_bit to avoid storage, makes
  the common cases of the instance size smaller.
- Reorder some flags and down size the enums to contain the bits needed.
- Reorder the items in the structures to manually ensure they are are packed
  better (especially when generating 64bit code - 8 bytes for every field,
  16 bytes for every extension, instance sizes 8 bytes also).
- Split off the structure initialization so when the default is zero, the
  generated static storage doesn't need to reserve the space. This is batched
  at the message level, so all the fields for the message have to have zero
  defaults to get the saves. By definition all proto3 syntax  files fall into
  this case but it also saves space for the proto2 that use the standard
  defaults. (saves 8 bytes of static data for every field that had a zero
  default)
- Don't track the enums defined by a message. Nothing in the runtime needs it
  and it was just generation and runtime overhead. (saves 8 bytes per enum)
- Ensure EnumDescriptors are started up threadsafe in all cases.
- Split some of the Descriptor initialization into multiple methods so the
  generated code isn't padded with lots of zero/nil args.
- Change how oneof info is feed to the runtime enabling us to generate less
  static data (8 bytes saved per oneof for 64bit).
- Change how enum value informat is capture to pack the data and only decode
  it if it ends up being needed. Avoids padding issues causing bloat of 64bit,
  and removes the needs for extra pointers in addition to the data (just the
  data and one pointer now).
2016-03-17 10:04:21 -04:00
benchmarks More cleanup, based around searches for "Google.ProtocolBuffers" 2015-06-26 20:13:07 +01:00
cmake Clarified that 'nmake' must be run before 'nmake check'. 2016-02-10 14:44:29 -08:00
conformance Changed Ruby to properly camelCase its JSON by default. 2016-02-18 10:50:14 -08:00
csharp Replace StringBuilder with TextWriter in JsonFormatter 2016-03-06 17:50:02 -08:00
editors down-integrate internal changes 2015-05-21 19:32:02 -07:00
examples Merge pull request #1144 from dongjoon-hyun/remove_redundant_the 2016-02-11 17:17:48 -08:00
java Remove redundant the in comments. 2016-02-03 15:27:27 -08:00
javanano Update version number and fix javadoc errors. 2016-01-06 15:47:41 -08:00
js Moved CommonJS-specific files into commonjs directory 2016-02-24 14:23:08 -08:00
m4 Merge pull request #789 from motahan/solaris64_fix 2016-01-20 16:57:01 -08:00
more_tests Add makefile for extended tests to be run before release. 2010-01-12 22:45:15 +00:00
objectivec Shrink ObjC overhead (generated size and some runtime sizes) 2016-03-17 10:04:21 -04:00
protoc-artifacts Fix typos in README.md/CHANGES.txt 2016-01-11 14:52:01 -08:00
python Merge pull request #1306 from silviulica/master 2016-03-07 16:31:48 -08:00
ruby Merge pull request #1139 from haberman/rubyjsoncamel 2016-03-04 17:31:11 -08:00
src Shrink ObjC overhead (generated size and some runtime sizes) 2016-03-17 10:04:21 -04:00
util/python Remove hack for building Python support with Bazel. 2016-02-25 12:52:21 -08:00
.gitignore Manually down-integrate python JSON struct support from internal code base. 2016-01-29 18:10:50 -08:00
.travis.yml List python_cpp as failing on OS X 2016-02-18 13:22:05 -05:00
appveyor.bat Improved SHARED build from CMake project 2015-10-15 02:56:48 +03:00
appveyor.yml Down-integrate from internal code base. 2015-12-11 17:10:28 -08:00
autogen.sh Add support for arguments. 2015-10-13 09:42:20 -07:00
BUILD Merge pull request #1318 from smparkes/smparkes/grpc 2016-03-14 14:57:33 -07:00
CHANGES.txt Some fixes for the most recent release notes. 2016-02-18 13:59:33 -08:00
configure.ac Add missing files to EXTRA_DIST. 2015-12-28 14:18:49 -08:00
CONTRIBUTORS.txt Add nano proto authors and update LICENSE file to include Android.mk. 2014-11-20 14:27:46 -08:00
generate_descriptor_proto.sh Shrink ObjC overhead (generated size and some runtime sizes) 2016-03-17 10:04:21 -04:00
gmock.BUILD Fix headers for gmock.BUILD 2015-12-01 22:52:42 +01:00
LICENSE Add support for POWER Linux 2015-11-03 14:49:42 -08:00
Makefile.am Shrink ObjC overhead (generated size and some runtime sizes) 2016-03-17 10:04:21 -04:00
post_process_dist.sh Add js to post_process_dist.sh. 2015-12-28 16:31:10 -08:00
protobuf-lite.pc.in Uncomment conflict fields from pkg-config files. 2015-05-12 17:50:05 +02:00
protobuf.bzl pass correct args to protoc for java wellknown protos when used as an external repository 2016-03-10 15:04:46 -08:00
protobuf.pc.in Uncomment conflict fields from pkg-config files. 2015-05-12 17:50:05 +02:00
Protobuf.podspec Shrink ObjC overhead (generated size and some runtime sizes) 2016-03-17 10:04:21 -04:00
README.md Fix typos in README.md 2016-01-25 21:41:31 +01:00
six.BUILD Add srcs_version = "PY2AND3" in BUILD files 2015-12-03 13:16:06 -08:00
travis.sh Disable the xctool updates 2016-02-18 12:13:20 -05:00
update_file_lists.sh Fix bugs on windows 2015-08-25 17:58:48 -07:00
WORKSPACE add java/util support based on java/util/pom.xml 2016-03-11 18:08:09 -08:00

Protocol Buffers - Google's data interchange format

Build Status Build status

Copyright 2008 Google Inc.

https://developers.google.com/protocol-buffers/

Overview

Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. You can find protobuf's documentation on the Google Developers site.

This README file contains protobuf installation instructions. To install protobuf, you need to install the protocol compiler (used to compile .proto files) and the protobuf runtime for your chosen programming language.

Protocol Compiler Installation

The protocol compiler is written in C++. If you are using C++, please follow the C++ Installation Instructions to install protoc along with the C++ runtime.

For non-C++ users, the simplest way to install the protocol compiler is to download a pre-built binary from our release page:

https://github.com/google/protobuf/releases

In the downloads section of each release, you can find pre-built binaries in zip packages: protoc-$VERSION-$PLATFORM.zip. It contains the protoc binary as well as a set of standard .proto files distributed along with protobuf.

If you are looking for an old version that is not available in the release page, check out the maven repo here:

http://repo1.maven.org/maven2/com/google/protobuf/protoc/

These pre-built binaries are only provided for released versions. If you want to use the github master version at HEAD, or you need to modify protobuf code, or you are using C++, it's recommended to build your own protoc binary from source.

If you would like to build protoc binary from source, see the C++ Installation Instructions.

Protobuf Runtime Installation

Protobuf supports several different programming languages. For each programming language, you can find instructions in the corresponding source directory about how to install protobuf runtime for that specific language:

Language Source
C++ (include C++ runtime and protoc) src
Java java
Python python
Objective-C objectivec
C# csharp
JavaNano javanano
JavaScript js
Ruby ruby
Go golang/protobuf
PHP TBD

Usage

The complete documentation for Protocol Buffers is available via the web at:

https://developers.google.com/protocol-buffers/