Skip to content

all: add "protolite" build mode #1154

Open
@dsnet

Description

@dsnet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions