PyPy – a faster Python
Written by Alex Denham   
Friday, 26 September 2014

PyPy 2.4, aka Snow White, has been released with significant performance enhancements and bug fixes.


PyPy already has a reputation as being the way to get better performance from Python programs, running code an average of six times faster than the ‘standard’ Python interpreter. One of the main reasons for this performance improvement is PyPy’s use of a JIT (Just In Time) compiler. According to comparison performance tests on the PyPy Speed Center, the average improvement over CPython for the new version is 6.6 times faster, though they do point out the actual improvement depends greatly on the type of task being performed.



The improvement in performance comes courtesy of internal enhancements in string and bytearray handling, and a major rewrite of the GIL handling, according to the release documentation, which says that that external calls are now a lot faster, especially the CFFI ones. It also means better performance in a lot of corner cases with handling strings or bytearrays.

The new version of PyPy has been developed under the code name Snow White, and as well as the improvements in performance has a number of bug fixes. It also supports Python's 2.7.8 standard library.

The main bug fix is to the handling of socket objects. These were responsible for memory leaks over the long run in programs, but no longer do so. Another memory leak, this time in I/O in the sandbox code, has also been fixed.

Other bug fixes were those reported by users, including tweaks to the internal structure of StringBuilder to speed up large string handling. This has slightly slowed smaller benchmark programs, but will prove advantageous for large programs.

The performance of thread-local variables in both unjitted and jitted code has been boosted. This this mostly affects errno handling on linux, which makes external calls faster. Another improvement is a move to a mixed polling and mutex GIL model that make mutlithreaded code compiled using JIT run much faster. The GIL serializes multiple thread access to the Python interpreter, and has been a major cause of Python’s slow performance.

For Python enthusiasts, one drawback to PyPy is the fact it doesn’t support Python 3, though developers are working on making that possible and has a fund raising campaign on its website.



More Information

PyPy 2.4 - Snow White

Download PyPy 2.4.0

PyPy Status Blog

Related Articles

PyPy 2.0 Released

Pyston 0.2 Python Compiler

Micro Python - The Latest Python

Python Tools for Visual Studio 2.1 Beta


To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.



Conference Times Ahead

Following a well-established pattern both Google's and Microsoft's Developer Conferences will take place in May while Apple follows on in June. Here are the dates plus what to expect.

Apache Updates Geronimo Arthur

Apache Geronimo Arthur has been updated with support for Common-compress, XBean, and ensures the default options are compatible with last GraalVM release.

More News


raspberry pi books



or email your comment to:

Last Updated ( Wednesday, 04 February 2015 )