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.

pypy

 

More Information

PyPy 2.4 - Snow White

Download PyPy 2.4.0

PyPy.org

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.

 

Banner


Bun Shell Released
29/02/2024

The developers of the Bun JavaScript runtime have released Bun Shell, a new experimental embedded language and interpreter in Bun that lets you run cross-platform shell scripts in JavaScript and TypeS [ ... ]



Quantum Computers Really Are A One Trick Pony
17/03/2024

Google is offering $5 million if you can think up a use for a quantum computer. Wait, I thought quantum computers were the next big thing, a revolution! Surely we know what they can do?


More News

 

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Wednesday, 04 February 2015 )