I've been hearing a lot about the PyPy project. They claim it is 6.3 times faster than the CPython interpreter on their site.
Whenever we talk about dynamic languages like Python, speed is one of the top issues. To solve this, they say PyPy is 6.3 times faster.
The second issue is parallelism, the infamous Global Interpreter Lock (GIL). For this, PyPy says it can give GIL-less Python.
If PyPy can solve these great challenges, what are its weaknesses that are preventing wider adoption? That is to say, what's preventing someone like me, a typical Python developer, from switching to PyPy right now?
The PyPy implementation is 16 times faster than the CPython implementation and about 3 times slower than the Cython implementation. This is fascinating since PyPy is running the exact same pure Python code as the CPython implementation – it shows the power of PyPy's JIT compiler.
PyPy works best with pure Python apps Numpy, for instance, works very well with PyPy now. But if you want maximum compatibility with C extensions, use CPython.
In this small synthetic benchmark, PyPy is roughly 94 times as fast as Python! For more serious benchmarks, you can take a look at the PyPy Speed Center, where the developers run nightly benchmarks with different executables.
Speed: thanks to its Just-in-Time compiler, Python programs often run faster on PyPy. (What is a JIT compiler?) Memory usage: memory-hungry Python programs (several hundreds of MBs or more) might end up taking less space than they do in CPython. Compatibility: PyPy is highly compatible with existing python code.
NOTE: PyPy is more mature and better supported now than it was in 2013, when this question was asked. Avoid drawing conclusions from out-of-date information.
Those are the main reasons that affect me, I'd say.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With