Hacker News new | ask | show | jobs
by functional_dev 20 days 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-...

1 comments

> 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.

rust code tends to be incredibly slow unless you spend a ton of time optimizing (compared to other compiled languages, and contrary to popular belief).