5 ms·
I did not know this before... Google protobuf is not one thing, it is three! Same import, but: * old C++ extension * upb * pure Python upb parses FAST, but
by functional_dev 2mo ago
I did not know this before... Google protobuf is not one thing, it is three! Same import, but:
* old C++ extension
* upb
* pure Python
upb parses FAST, but then every access is still C->Python and it slows it down. So for many reads the slow python one can win?
This one helped me to dig deeper - https://vectree.io/c/how-python-protobuf-runtimes-work-pure-python-vs-upb-vs-the-c-backend https://vectree.io/c/how-python-protobuf-runtimes-work-pure-...
- masklinn 2mo ago> upb parses FAST, but then every access is still C->Python and it slows it down. So for many reads the slow python one can win? That is pretty unlikely. TFA's version is in Rust and just barely edges out upb.
- Chu4eeno 2mo agorust code tends to be incredibly slow unless you spend a ton of time optimizing (compared to other compiled languages, and contrary to popular belief).