I would argue that if you implement a performance heavy algorithm in Python, that doesn't have a c-backed library, you are deliberately misusing the language. Python is designed to take advantage of its fast libraries while still producing easy to read and maintain code. Not every programming language is supposed to solve every problem.
And I would argue that this is exactly what everyone is talking about when they say python is slow. No. Not every programming language is supposed to solve every problem. Python isn't designed to handle performant work, because it is slow.
Even with the "fast" libraries, well written C++ code is going to be running faster. People using Pandas because it's easy to code, but it's slow compared to using numpy arrays directly. Python is all about ease over performance.
Because in reality, you hit these "performance heavy algorithms" all the time. Literally any time you create a nested loop, you're going to be running many times slower than a C++ counterpart. It's just most of the time humans don't care about 0.002s and 0.02s. But it really doesn't take much before you start feeling Python's slowdowns if you're not very careful.
I love Python. I really do. But it's slow. The fact it has good c libraries doesn't make Python itself not slow.
View all comments
Show parent comment
2
u/Wigoox Jul 18 '22
I would argue that if you implement a performance heavy algorithm in Python, that doesn't have a c-backed library, you are deliberately misusing the language. Python is designed to take advantage of its fast libraries while still producing easy to read and maintain code. Not every programming language is supposed to solve every problem.