4 ms·
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 obv
by foobiekr 3y ago
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.
- tignaj 3y agoThis 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 https://github.com/splunk/exp-lazyproto
- haberman 3y agoMore and more languages are being built on top of the "upb" C library for protobuf (https://github.com/protocolbuffers/upb 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.
- foobiekr 3y agoAgreed but please do something about Go.