Skip to content

proto: specialize map<string, string> for performance #781

Open
@jmillikin-stripe

Description

@jmillikin-stripe

Background: #624

Serialization of map fields currently hits a slow, reflection-based path. This is understandable for the general case (nested messages are hard), but there are some special cases where maps get used a lot and a fast path would be very valuable.

My specific use case is a map<string, string> used to represent arbitrary human-meaningful metadata in a distributed monitoring system (similar to Prometheus). Benchmarking shows that our tooling is spending a material amount of CPU time in the closures returned from proto.makeMapMarshaler.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions