Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strengths and weaknesses of JIT compilers for Python

I'm currently aware of the following Python JIT compilers: Psyco, PyPy and Unladen Swallow.

Basically, I'd like to ask for your personal experiences on the strengths and weaknesses of these compilers - and if there are any others worth looking into.

Thanks in advance,

Az

like image 593
PizzAzzra Avatar asked May 29 '10 01:05

PizzAzzra


2 Answers

Christian Perone has an excellent article from just a few days ago where he claims (with supporting benchmark data) that PyPy is now the fastest, running the benchmark in 145 seconds vs 300 for Unladen Swallow and 374 for CPython (Psyco doesn't help, actually PsycoV2 slows the benchmark down to 434 seconds), 557 for Jython -- see the URL I just gave for all details.

Of course, you'd need to confirm this on a wide range of benchmarks, but it sure seems credible and very interesting. Pypy has the largest team working on it (and has had for many years, including several years with generous monetary support from European Union research grants), which is why it's quite credible that it's now "fully in gear" and ready for prime time!-)

like image 103
Alex Martelli Avatar answered Sep 24 '22 21:09

Alex Martelli


Some other tools you might investigate to speed up python are

  • Cython, which requires type specification of all variables in the relevant method and then statically compiles the method
  • Numba, which requires LLVM but is JIT (methods must be decorated with argument types for compilation to occur).
like image 41
jnnnnn Avatar answered Sep 23 '22 21:09

jnnnnn