Re:Rob Pike interview
by potta_coffee on Friday May 01, 2020 @07:36PM
(#23047610)
I realize that with a lot of effort, Python can be performant or can be scaled. It was a pretty low-effort move to rewrite my Python service (which was pretty small) in Go and go from really poor performance to acceptable performance right away, and it only took me a short time. Also, I'm pretty good at Python but I'm not very knowledgeable about optimizing it for performance. I'd like to learn those tricks though.
Sometimes with the right approach (mapping PostgreSQL calls 1:1) and right tooling (uvloop, Cython) you can write code in Python and still squeeze better performance than in Go[1], but you need to know what you're doing.
If you want to explore types, these resources[2][3] were useful for me.
[1] https://github.com/MagicStack/asyncpg
[2] https://mypy.readthedocs.io/en/stable/
[3] https://docs.python.org/3/library/typing.htm