Skip to content

all: add "protolite" build mode #1154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dsnet opened this issue Jun 22, 2020 · 1 comment
Open

all: add "protolite" build mode #1154

dsnet opened this issue Jun 22, 2020 · 1 comment
Milestone

Comments

@dsnet
Copy link
Member

dsnet commented Jun 22, 2020

There's no question that the current implementation of protobufs is geared towards server environments with large amounts of memory. This issue proposes the addition of a build mode (perhaps controlled by a build tag) that optimizes for a constrained environment with low memory availability, a small footprint for binary size, or both.

Challenges:

  • The dynamic creation of table-driven serializers does incur quite a bit of memory overhead. Fortunately, it's based on a per-use basis.
  • Small binary footprint often runs contrary to attempts at full code-generation of the serialization logic (see protoc-gen-go: fully generate marshaling and unmarshaling code #280).
  • The protobuf language has a large set of features and the runtime supports all of them. For example, a user of proto3 only does not care about extensions, but extensions support has quite a lot of complexity.
  • The runtime provides a large degree of backwards compatibility with messages that have not been regenerated in a long time. This is runtime support that costs binary size and will not matter for users that have sufficiently updated messages.

\cc @neild @bradfitz

@hugelgupf
Copy link

We (LinuxBoot / u-root / go/nerf) would also really appreciate this, in terms of small binary size footprint (we have no such memory constraints). We use protos and gRPC in environments that need to compress to < 4-6MB, and gRPC and protos are one of the larger components of that. It currently works out, but I'm worried about that changing in the future.

@dsnet dsnet added this to the unplanned milestone Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants