C++ is Still 100 Times Faster Than a Compiled Version of Python
guest reader writes:
The Register has a story about a Python compiler called Codon that turns Python code into native machine code without a runtime performance hit.:
Python is among the one of the most popular programming languages, yet it's generally not the first choice when speed is required.
"Typical speedups over Python are on the order of 10-100x or more, on a single thread," the Codon repo declares. "Codon's performance is typically on par with (and sometimes better than) that of C/C++."
"Unlike other performance-oriented Python implementations (such as PyPy or Numba), Codon is built from the ground up as a standalone system that compiles ahead-of-time to a static executable and is not tied to an existing Python runtime (e.g., CPython or RPython) for execution," the paper says. "As a result, Codon can achieve better performance and overcome runtime-specific issues such as the global interpreter lock."
C++ Weekly - Ep 366 - C++ vs Compiled Python (Codon) performs a benchmark by running the same algorithm in Python (Codon) 8.4 seconds and C++ which takes 0.09 seconds. The video also points out the following:
We need a python code that works with codon. It takes some porting. We have to give types. It is a lot like C++ in this regard.
Read more of this story at SoylentNews.