3 ms·
Well, if performance is the objective, then I can't suggest Python, because that isn't the goal. You can still have a performant application implemented in Pyth
by takeda 7y ago
Well, if performance is the objective, then I can't suggest Python, because that isn't the goal. You can still have a performant application implemented in Python, I for example had it encode video stream on the fly, but this of course is done through extensibility via C extensions and the core work wasn't really done in Python itself.
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 https://github.com/MagicStack/asyncpg
[2] https://mypy.readthedocs.io/en/stable/ https://mypy.readthedocs.io/en/stable/
[3] https://docs.python.org/3/library/typing.htm https://docs.python.org/3/library/typing.htm
- potta_coffee 7y agoI 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.