Re:Cap'n Proto 1.0
by foobiekr on Friday July 28, 2023 @01:09PM
(#36909991)
One thing about google proto is that, at least in many languages, every message throws off a ton of garbage that stresses the GC. On the send side, you can obviously re-use objects, but on the receive side no.
[ Parent
| on HN ]
This is also because Google's Protobuf implementations aren't doing a very good job with avoiding unnecessary allocations. Gogoproto is better and it is possible to do even better, here is an example prototype I have put together for Go (even if you do not use the laziness part it is still much faster than Google's implementation): https://github.com/splunk/exp-lazyproto
More and more languages are being built on top of the "upb" C library for protobuf (https://github.com/protocolbuffers/upb) which is designed around arenas to avoid this very problem.
Currently Ruby, PHP, and Python are backed by upb.
Disclosure: I work on the protobuf team, and created the upb library.