Rethinking Data Flow in gRPC-Go: Maximizing Memor...
summary
gRPC-Go replaces flat byte marshal/unmarshal with a ref‑counted m package that exposes buffer slice and buffer pool types so encoders and the transport pass around fragments without copying; a custom scatter-gather framer accepts buffer slices, removes internal framer buffering, and hands pooled buffers to callers. Benchmarks show LinkedIn running the PR in production with “huge gains” for very large protobuf messages, fewer allocations for small messages, and remaining copies only for network read and batch writer.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:05Memory usage motivations
- 1:49gRPC-Go encoding
- 2:55Proto encoding problems
- 6:25Copy/allocation issues
- 8:56mem package for buffers
- 11:27Transport layer overview
- 13:12http2 framer pain points
- 16:45Framer optimizations
- 17:48Q&A








