| 1 |
=============== |
| 2 |
PyPy 2.0 beta 2 |
| 3 |
=============== |
| 4 |
|
| 5 |
We're pleased to announce the 2.0 beta 2 release of PyPy. This is a major |
| 6 |
release of PyPy and we're getting very close to 2.0 final, however it includes |
| 7 |
quite a few new features that require further testing. Please test and report |
| 8 |
issues, so we can have a rock-solid 2.0 final. It also includes a performance |
| 9 |
regression of about 5% compared to 2.0 beta 1 that we hope to fix before |
| 10 |
2.0 final. The ARM support is not working yet and we're working hard to |
| 11 |
make it happen before the 2.0 final. The new major features are: |
| 12 |
|
| 13 |
* JIT now supports stackless features, that is greenlets and stacklets. This |
| 14 |
means that JIT can now optimize the code that switches the context. It enables |
| 15 |
running `eventlet`_ and `gevent`_ on PyPy (although gevent requires some |
| 16 |
special support that's not quite finished, read below). |
| 17 |
|
| 18 |
* This is the first PyPy release that includes `cffi`_ as a core library. |
| 19 |
Version 0.6 comes included in the PyPy library. cffi has seen a lot of |
| 20 |
adoption among library authors and we believe it's the best way to wrap |
| 21 |
C libraries. You can see examples of cffi usage in `_curses.py`_ and |
| 22 |
`_sqlite3.py`_ in the PyPy source code. |
| 23 |
|
| 24 |
You can download the PyPy 2.0 beta 2 release here: |
| 25 |
|
| 26 |
https://pypy.org/download.html |
| 27 |
|
| 28 |
What is PyPy? |
| 29 |
============= |
| 30 |
|
| 31 |
PyPy is a very compliant Python interpreter, almost a drop-in replacement for |
| 32 |
CPython 2.7.3. It's fast (`pypy 2.0 beta 2 and cpython 2.7.3`_ |
| 33 |
performance comparison) due to its integrated tracing JIT compiler. |
| 34 |
|
| 35 |
This release supports x86 machines running Linux 32/64, Mac OS X 64 or |
| 36 |
Windows 32. It also supports ARM machines running Linux, however this is |
| 37 |
disabled for the beta 2 release. |
| 38 |
Windows 64 work is still stalling, we would welcome a volunteer |
| 39 |
to handle that. |
| 40 |
|
| 41 |
.. _`pypy 2.0 beta 2 and cpython 2.7.3`: https://bit.ly/USXqpP |
| 42 |
|
| 43 |
How to use PyPy? |
| 44 |
================ |
| 45 |
|
| 46 |
We suggest using PyPy from a `virtualenv`_. Once you have a virtualenv |
| 47 |
installed, you can follow instructions from `pypy documentation`_ on how |
| 48 |
to proceed. This document also covers other `installation schemes`_. |
| 49 |
|
| 50 |
.. _`pypy documentation`: https://doc.pypy.org/getting-started.html#installing-using-virtualenv |
| 51 |
.. _`virtualenv`: https://www.virtualenv.org/en/latest/ |
| 52 |
.. _`installation schemes`: https://doc.pypy.org/getting-started.html#installing-pypy |
| 53 |
|
| 54 |
Highlights |
| 55 |
========== |
| 56 |
|
| 57 |
* ``cffi`` is officially supported by PyPy. It comes included in the standard |
| 58 |
library, just use ``import cffi`` |
| 59 |
|
| 60 |
* stackless support - `eventlet`_ just works and `gevent`_ requires `pypycore`_ |
| 61 |
and `pypy-hacks`_ branch of gevent (which mostly disables cython-based |
| 62 |
modules) |
| 63 |
|
| 64 |
* callbacks from C are now much faster. pyexpat is about 3x faster, cffi |
| 65 |
callbacks around the same |
| 66 |
|
| 67 |
* ``__length_hint__`` is implemented (PEP 424) |
| 68 |
|
| 69 |
* a lot of numpy improvements |
| 70 |
|
| 71 |
Improvements since 1.9 |
| 72 |
====================== |
| 73 |
|
| 74 |
* `JIT hooks`_ are now a powerful tool to introspect the JITting process that |
| 75 |
PyPy performs |
| 76 |
|
| 77 |
* various performance improvements compared to 1.9 and 2.0 beta 1 |
| 78 |
|
| 79 |
* operations on ``long`` objects are now as fast as in CPython (from |
| 80 |
roughly 2x slower) |
| 81 |
|
| 82 |
* we now have special strategies for ``dict``/``set``/``list`` which contain |
| 83 |
unicode strings, which means that now such collections will be both faster |
| 84 |
and more compact. |
| 85 |
|
| 86 |
.. _`eventlet`: https://eventlet.net/ |
| 87 |
.. _`gevent`: https://www.gevent.org/ |
| 88 |
.. _`cffi`: https://cffi.readthedocs.org/en/release-0.6/ |
| 89 |
.. _`JIT hooks`: https://doc.pypy.org/jit-hooks.html |
| 90 |
.. _`pypycore`: https://github.com/gevent-on-pypy/pypycore |
| 91 |
.. _`pypy-hacks`: https://github.com/schmir/gevent/tree/pypy-hacks |
| 92 |
.. _`_curses.py`: https://bitbucket.org/pypy/pypy/src/aefddd47f224e3c12e2ea74f5c796d76f4355bdb/lib_pypy/_curses.py?at=default |
| 93 |
.. _`_sqlite3.py`: https://bitbucket.org/pypy/pypy/src/aefddd47f224e3c12e2ea74f5c796d76f4355bdb/lib_pypy/_sqlite3.py?at=default |
| 94 |
|