We're pleased to announce an alpha release of PyPy 2.0 for ARM. This is mostly a technology preview, as we know the JIT is not yet stable enough for the full release. However please try your stuff on ARM and report back.
This is the first release that supports a range of ARM devices - anything with ARMv6 (like the Raspberry Pi) or ARMv7 (like Beagleboard, Chromebook, Cubieboard, etc.) that supports VFPv3 should work. We provide builds with support for both ARM EABI variants: hard-float and some older operating systems soft-float.
This release comes with a list of limitations, consider it alpha quality, not suitable for production:
- stackless support is missing.
- assembler produced is not always correct, but we successfully managed to run large parts of our extensive benchmark suite, so most stuff should work.
You can download the PyPy 2.0 alpha ARM release here (including a deb for raspbian):
Part of the work was sponsored by the Raspberry Pi foundation.
What is PyPy?
PyPy is a very compliant Python interpreter, almost a drop-in replacement for CPython 2.7.3. It's fast due to its integrated tracing JIT compiler.
This release supports ARM machines running Linux 32bit. Both hard-float armhf and soft-float armel builds are provided. armhf builds are created using the Raspberry Pi custom cross-compilation toolchain based on gcc-arm-linux-gnueabihf and should work on ARMv6 and ARMv7 devices running at least debian or ubuntu. armel builds are built using gcc-arm-linux-gnuebi toolchain provided by ubuntu and currently target ARMv7. If there is interest in other builds, such as gnueabi for ARMv6 or without requiring a VFP let us know in the comments or in IRC.
Everybody loves benchmarks. Here is a table of our benchmark suite (for ARM we don't provide it yet on https://speed.pypy.org, unfortunately).
This is a comparison of Cortex A9 processor with 4M cache and Xeon W3580 with 8M of L3 cache. The set of benchmarks is a subset of what we run for https://speed.pypy.org that finishes in reasonable time. The ARM machine was provided by Calxeda. Columns are respectively:
- benchmark name
- PyPy speedup over CPython on ARM (Cortex A9)
- PyPy speedup over CPython on x86 (Xeon)
- speedup on Xeon vs Cortex A9, as measured on CPython
- speedup on Xeon vs Cortex A9, as measured on PyPy
- relative speedup (how much bigger the x86 speedup is over ARM speedup)
|Benchmark||PyPy vs CPython (arm)||PyPy vs CPython (x86)||x86 vs arm (pypy)||x86 vs arm (cpython)||relative speedup|
It seems that Cortex A9, while significantly slower than Xeon, has higher slowdowns with a large interpreter (CPython) than a JIT compiler (PyPy). This comes as a surprise to me, especially that our ARM assembler is not nearly as polished as our x86 assembler. As for the causes, various people mentioned branch predictor, but I would not like to speculate without actually knowing.
How to use PyPy?
We suggest using PyPy from a virtualenv. Once you have a virtualenv installed, you can follow instructions from pypy documentation on how to proceed. This document also covers other installation schemes.
We would not recommend using in production PyPy on ARM just quite yet, however the day of a stable PyPy ARM release is not far off.
fijal, bivab, arigo and the whole PyPy team