Since Python is an interpreted language in its most commonly used CPython implementation, it is many times slower in a variety of tasks than the most commonly used compiled non-managed languages such as C and C++; for some tasks, it is more than 100 times slower. CPython seems to be on par with Perl, another interpreted language, slower on some tasks, faster on other tasks.
Performance can be measured using benchmarks. Benchmarks are often far from representative of the real-world usage and have to be taken with a grain of salt. Some benchmarks are outright wrong in that non-idiomatic code is used for a language, yielding avoidably low performance for the language.
PyPy is a just-in-time (JIT) compiler that often runs faster than CPython. Another compiler that can lead to greater speeds is Numba, which works for a subset of Python. Yet another compiler is Cython, not to be confused with CPython.
[edit | edit source]
- Python 3 versus C gcc fastest programs, benchmarksgame-team.pages.debian.net
- Python 3 versus Java fastest programs, benchmarksgame-team.pages.debian.net
- Python 3 versus Go fastest programs, benchmarksgame-team.pages.debian.net
- Perl versus Python 3 fastest programs, benchmarksgame-team.pages.debian.net
- Python speed center, speed.python.org
- pypy speed center, speed.pypy.org
- Python Interpreters Benchmarks, pybenchmarks.org
- Performance of Python runtimes on a non-numeric scientific code by Riccardo Murri, arxiv.org
- How To Make Python Run As Fast As Julia by Jean Francois Puget, ibm.com