DEV Community

[Comment from a deleted post]
Collapse
 
bloodgain profile image
Cliff • Edited

The criticism of Python's performance isn't totally off-base here, but it's incomplete. Yes, the CPython interpreter is not the fastest. But among interpreted languages, it's not bad.

A friend of mine's favorite work-time hobby is proving that when someone says "Python is too slow", it's because they're not a good programmer, not because of Python. It's usually down to mistakes -- that are often made in other languages, too -- like using loops and especially nested loops unnecessarily, bad handling of data types (string manipulation is usually the worst offender), blocking on I/O instead of doing it asynchronously, not leveraging the language features, etc. Note that this same friend wrote and maintains a Python-based application that manages high-def, high-speed camera data on a network link that has to be handled in a bitstream (i.e. OSI Level 1, no packetizing) because it saturates a 10 Gbps link in raw throughput. Yes, some of that got optimized into Cython, but by starting with Python, he was able to have a pretty performant version written in a month full of weekends and continue optimizing and extending it from there.

Python cares more about productivity than performance, but it gives you the tools to write for performance, too. It just doesn't optimize prematurely.