PyPy 2.0 beta 2 released
We're pleased to announce the 2.0 beta 2 release of PyPy. This is a major release of PyPy and we're getting very close to 2.0 final, however it includes quite a few new features that require further testing. Please test and report issues, so we can have a rock-solid 2.0 final. It also includes a performance regression of about 5% compared to 2.0 beta 1 that we hope to fix before 2.0 final. The ARM support is not working yet and we're working hard to make it happen before the 2.0 final. The new major features are:
- JIT now supports stackless features, that is greenlets and stacklets. This means that JIT can now optimize the code that switches the context. It enables running eventlet and gevent on PyPy (although gevent requires some special support that's not quite finished, read below).
- This is the first PyPy release that includes cffi as a core library. Version 0.6 comes included in the PyPy library. cffi has seen a lot of adoption among library authors and we believe it's the best way to wrap C libaries. You can see examples of cffi usage in _curses.py and _sqlite3.py in the PyPy source code.
You can download the PyPy 2.0 beta 2 release here:
https://pypy.org/download.html
What is PyPy?¶
PyPy is a very compliant Python interpreter, almost a drop-in replacement for CPython 2.7.3. It's fast (pypy 2.0 beta 2 and cpython 2.7.3 performance comparison) due to its integrated tracing JIT compiler.
This release supports x86 machines running Linux 32/64, Mac OS X 64 or Windows 32. It also supports ARM machines running Linux, however this is disabled for the beta 2 release. Windows 64 work is still stalling, we would welcome a volunteer to handle that.
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.
Highlights¶
- cffi is officially supported by PyPy. It comes included in the standard library, just use import cffi
- stackless support - eventlet just works and gevent requires pypycore and pypy-hacks branch of gevent (which mostly disables cython-based modules)
- callbacks from C are now much faster. pyexpat is about 3x faster, cffi callbacks around the same
- __length_hint__ is implemented (PEP 424)
- a lot of numpy improvements
Improvements since 1.9¶
- JIT hooks are now a powerful tool to introspect the JITting process that PyPy performs
- various performance improvements compared to 1.9 and 2.0 beta 1
- operations on long objects are now as fast as in CPython (from roughly 2x slower)
- we now have special strategies for dict/set/list which contain unicode strings, which means that now such collections will be both faster and more compact.
Comments
why do you ship with pypy sqlite version 3.5.9 (windows version),
this is an old version which doesn't support wal mode
2008-May-12 - Version 3.5.9
Congratulations! And hope the ARM version of PyPy together with ARM v6 support will also coming soon.
Can you explain "performance regression of about 5% " and also "various performance improvements compared to 1.9 and 2.0 beta 1"?
What is faster and what is slower?
And we've got a lot of segfaults with beta2…
@Anonymous - please report those. It's impossible for us to determine what's going on without reporting back.
Thank you for great job.
Do you plan to release 64-bit binaries for Windows?
I'm trying to build from tag "pypy-2.0-beta2" under Windows7 x64, with MSVC compiler AMD-64, and I've got an exception:
[translation:ERROR] TypeError: <Struct PyTypeObject { c_ob_refcnt, c__pad0, c__pad1, c__pad2, c__pad3, c_ob_type, c_ob_size, c__pad4, c__pad5, c__pad6, c__pad7, c_tp_name, c_tp_basicsize, c_tp_itemsize, c_tp_dealloc, c_tp_print, c_tp_getattr, c_tp_setattr, c_tp_compare, c_tp_repr, c_tp_as_number, c_tp_as_sequence, c_tp_as_mapping, c_tp_hash, c_tp_call, c_tp_str, c_tp_getattro, c_tp_setattro, c_tp_as_buffer, c_tp_flags, c__pad8, c__pad9, c__pad10, c__pad11, c_tp_doc, c_tp_traverse, c_tp_clear, c_tp_richcompare, c_tp_weaklistoffset, c__pad12, c__pad13, c__pad14, c__pad15, c_tp_iter, c_tp_iternext, c_tp_methods, c_tp_members, c_tp_getset, c_tp_base, c_tp_dict, c_tp_descr_get, c_tp_descr_set, c_tp_dictoffset, c__pad16, c__pad17, c__pad18, c__pad19, c_tp_init, c_tp_alloc, c_tp_new, c_tp_free, c_tp_is_gc, c_tp_bases, c_tp_mro, c_tp_cache, c_tp_subclasses, c_tp_weaklist, c_tp_del, c__pad20, c__pad21, c__pad22, c__pad23, c__pad24, c__pad25, c__pad26, c__pad27 }> instance field 'c_ob_refcnt':
[translation:ERROR] expects <INT>
[translation:ERROR] got <Signed>
As it says in the release announcement, win64 is not supported. You need to build a 32bit binary (using 32bit Python)
great news, waiting for the final v2.0