| 1 |
======== |
| 2 |
PyPy 5.0 |
| 3 |
======== |
| 4 |
|
| 5 |
We have released PyPy 5.0, about three months after PyPy 4.0.1. |
| 6 |
We encourage all users of PyPy to update to this version. Apart from the usual |
| 7 |
bug fixes, there is an ongoing effort to improve the warmup time and memory |
| 8 |
usage of JIT-related metadata. The exact effects depend vastly on the program |
| 9 |
you're running and can range from insignificant to warmup being up to 30% |
| 10 |
faster and memory dropping by about 30%. |
| 11 |
|
| 12 |
We also merged a major upgrade to our C-API layer (cpyext), simplifying the |
| 13 |
interaction between c-level objects and PyPy interpreter level objects. As a |
| 14 |
result, lxml (prerelease) with its cython compiled component |
| 15 |
passes all tests on PyPy. The new cpyext is also much faster. |
| 16 |
|
| 17 |
vmprof_ has been a go-to profiler for PyPy on linux for a few releases |
| 18 |
and we're happy to announce that thanks to the cooperation with jetbrains, |
| 19 |
vmprof now works on Linux, OS X and Windows on both PyPy and CPython. |
| 20 |
|
| 21 |
You can download the PyPy 5.0 release here: |
| 22 |
|
| 23 |
https://pypy.org/download.html |
| 24 |
|
| 25 |
We would like to thank our donors for the continued support of the PyPy |
| 26 |
project. |
| 27 |
|
| 28 |
We would also like to thank our contributors and |
| 29 |
encourage new people to join the project. PyPy has many |
| 30 |
layers and we need help with all of them: `PyPy`_ and `RPython`_ documentation |
| 31 |
improvements, tweaking popular `modules`_ to run on pypy, or general `help`_ |
| 32 |
with making RPython's JIT even better. |
| 33 |
|
| 34 |
CFFI |
| 35 |
==== |
| 36 |
|
| 37 |
While not applicable only to PyPy, `cffi`_ is arguably our most significant |
| 38 |
contribution to the python ecosystem. PyPy 5.0 ships with |
| 39 |
`cffi-1.5.2`_ which now allows embedding PyPy (or cpython) in a C program. |
| 40 |
|
| 41 |
.. _`PyPy`: https://doc.pypy.org |
| 42 |
.. _`RPython`: https://rpython.readthedocs.org |
| 43 |
.. _`cffi`: https://cffi.readthedocs.org |
| 44 |
.. _`cffi-1.5.2`: https://cffi.readthedocs.org/en/latest/whatsnew.html#v1-5-2 |
| 45 |
.. _`modules`: https://doc.pypy.org/project-ideas.html#make-more-python-modules-pypy-friendly |
| 46 |
.. _`help`: https://doc.pypy.org/project-ideas.html |
| 47 |
.. _`numpy`: https://bitbucket.org/pypy/numpy |
| 48 |
.. _vmprof: https://vmprof.readthedocs.org |
| 49 |
|
| 50 |
What is PyPy? |
| 51 |
============= |
| 52 |
|
| 53 |
PyPy is a very compliant Python interpreter, almost a drop-in replacement for |
| 54 |
CPython 2.7. It's fast (`PyPy and CPython 2.7.x`_ performance comparison) |
| 55 |
due to its integrated tracing JIT compiler. |
| 56 |
|
| 57 |
We also welcome developers of other |
| 58 |
`dynamic languages`_ to see what RPython can do for them. |
| 59 |
|
| 60 |
This release supports **x86** machines on most common operating systems |
| 61 |
(Linux 32/64, Mac OS X 64, Windows 32, OpenBSD, FreeBSD), |
| 62 |
newer **ARM** hardware (ARMv6 or ARMv7, with VFPv3) running Linux, and the |
| 63 |
big- and little-endian variants of **PPC64** running Linux. |
| 64 |
|
| 65 |
.. _`PyPy and CPython 2.7.x`: https://speed.pypy.org |
| 66 |
.. _`dynamic languages`: https://pypyjs.org |
| 67 |
|
| 68 |
Other Highlights (since 4.0.1 released in November 2015) |
| 69 |
========================================================= |
| 70 |
|
| 71 |
* New features: |
| 72 |
|
| 73 |
* Support embedding PyPy in a C-program via cffi and static callbacks in cffi. |
| 74 |
This deprecates the old method of embedding PyPy |
| 75 |
|
| 76 |
* Refactor vmprof to work cross-operating-system, deprecate using buggy |
| 77 |
libunwind on Linux platforms. Vmprof even works on Windows now. |
| 78 |
|
| 79 |
* Support more of the C-API type slots, like tp_getattro, and fix C-API |
| 80 |
macros, functions, and structs such as _PyLong_FromByteArray(), |
| 81 |
PyString_GET_SIZE, f_locals in PyFrameObject, Py_NAN, co_filename in |
| 82 |
PyCodeObject |
| 83 |
|
| 84 |
* Use a more stable approach for allocating PyObjects in cpyext. (see |
| 85 |
`blog post`_). Once the PyObject corresponding to a PyPy object is created, |
| 86 |
it stays around at the same location until the death of the PyPy object. |
| 87 |
Done with a little bit of custom GC support. It allows us to kill the |
| 88 |
notion of "borrowing" inside cpyext, reduces 4 dictionaries down to 1, and |
| 89 |
significantly simplifies the whole approach (which is why it is a new |
| 90 |
feature while technically a refactoring) and allows PyPy to support the |
| 91 |
populart lxml module (as of the *next* release) with no PyPy specific |
| 92 |
patches needed |
| 93 |
|
| 94 |
* Make the default filesystem encoding ASCII, like CPython |
| 95 |
|
| 96 |
* Use `hypothesis`_ in test creation, which is great for randomizing tests |
| 97 |
|
| 98 |
* Bug Fixes |
| 99 |
|
| 100 |
* Backport always using os.urandom for uuid4 from cpython and fix the JIT as well |
| 101 |
(issue #2202) |
| 102 |
|
| 103 |
* More completely support datetime, optimize timedelta creation |
| 104 |
|
| 105 |
* Fix for issue #2185 which caused an inconsistent list of operations to be |
| 106 |
generated by the unroller, appeared in a complicated DJango app |
| 107 |
|
| 108 |
* Fix an elusive issue with stacklets on shadowstack which showed up when |
| 109 |
forgetting stacklets without resuming them |
| 110 |
|
| 111 |
* Fix entrypoint() which now acquires the GIL |
| 112 |
|
| 113 |
* Fix direct_ffi_call() so failure does not bail out before setting CALL_MAY_FORCE |
| 114 |
|
| 115 |
* Fix (de)pickling long values by simplifying the implementation |
| 116 |
|
| 117 |
* Fix RPython rthread so that objects stored as threadlocal do not force minor |
| 118 |
GC collection and are kept alive automatically. This improves performance of |
| 119 |
short-running Python callbacks and prevents resetting such object between |
| 120 |
calls |
| 121 |
|
| 122 |
* Support floats as parameters to itertools.isslice() |
| 123 |
|
| 124 |
* Check for the existence of CODESET, ignoring it should have prevented PyPy |
| 125 |
from working on FreeBSD |
| 126 |
|
| 127 |
* Fix for corner case (likely shown by Krakatau) for consecutive guards with |
| 128 |
interdependencies |
| 129 |
|
| 130 |
* Fix applevel bare class method comparisons which should fix pretty printing |
| 131 |
in IPython |
| 132 |
|
| 133 |
* Issues reported with our previous release were resolved_ after reports from users on |
| 134 |
our issue tracker at https://bitbucket.org/pypy/pypy/issues or on IRC at |
| 135 |
#pypy |
| 136 |
|
| 137 |
* Numpy: |
| 138 |
|
| 139 |
* Updates to numpy 1.10.2 (incompatibilities and not-implemented features |
| 140 |
still exist) |
| 141 |
|
| 142 |
* Support dtype=(('O', spec)) union while disallowing record arrays with |
| 143 |
mixed object, non-object values |
| 144 |
|
| 145 |
* Remove all traces of micronumpy from cpyext if --withoutmod-micronumpy option used |
| 146 |
|
| 147 |
* Support indexing filtering with a boolean ndarray |
| 148 |
|
| 149 |
* Support partition() as an app-level function, together with a cffi wrapper |
| 150 |
in pypy/numpy, this now provides partial support for partition() |
| 151 |
|
| 152 |
* Performance improvements: |
| 153 |
|
| 154 |
* Optimize global lookups |
| 155 |
|
| 156 |
* Improve the memory signature of numbering instances in the JIT. This should |
| 157 |
massively decrease the amount of memory consumed by the JIT, which is |
| 158 |
significant for most programs. Also compress the numberings using variable- |
| 159 |
size encoding |
| 160 |
|
| 161 |
* Optimize string concatenation |
| 162 |
|
| 163 |
* Use INT_LSHIFT instead of INT_MUL when possible |
| 164 |
|
| 165 |
* Improve struct.unpack by casting directly from the underlying buffer. |
| 166 |
Unpacking floats and doubles is about 15 times faster, and integer types |
| 167 |
about 50% faster (on 64 bit integers). This was then subsequently |
| 168 |
improved further in optimizeopt.py. |
| 169 |
|
| 170 |
* Optimize two-tuple lookups in mapdict, which improves warmup of instance |
| 171 |
variable access somewhat |
| 172 |
|
| 173 |
* Reduce all guards from int_floordiv_ovf if one of the arguments is constant |
| 174 |
|
| 175 |
* Identify permutations of attributes at instance creation, reducing the |
| 176 |
number of bridges created |
| 177 |
|
| 178 |
* Greatly improve re.sub() performance |
| 179 |
|
| 180 |
|
| 181 |
* Internal refactorings: |
| 182 |
|
| 183 |
* Refactor and improve exception analysis in the annotator |
| 184 |
|
| 185 |
* Remove unnecessary special handling of space.wrap(). |
| 186 |
|
| 187 |
* Support list-resizing setslice operations in RPython |
| 188 |
|
| 189 |
* Tweak the trace-too-long heuristic for multiple jit drivers |
| 190 |
|
| 191 |
* Refactor bookkeeping (such a cool word - three double letters) in the |
| 192 |
annotater |
| 193 |
|
| 194 |
* Refactor wrappers for OS functions from rtyper to rlib and simplify them |
| 195 |
|
| 196 |
* Simplify backend loading instructions to only use four variants |
| 197 |
|
| 198 |
* Simplify GIL handling in non-jitted code |
| 199 |
|
| 200 |
* Refactor naming in optimizeopt |
| 201 |
|
| 202 |
* Change GraphAnalyzer to use a more precise way to recognize external |
| 203 |
functions and fix null pointer handling, generally clean up external |
| 204 |
function handling |
| 205 |
|
| 206 |
* Remove pure variants of ``getfield_gc_*`` operations from the JIT by |
| 207 |
determining purity while tracing |
| 208 |
|
| 209 |
* Refactor databasing |
| 210 |
|
| 211 |
* Simplify bootstrapping in cpyext |
| 212 |
|
| 213 |
* Refactor rtyper debug code into python.rtyper.debug |
| 214 |
|
| 215 |
* Separate structmember.h from Python.h Also enhance creating api functions |
| 216 |
to specify which header file they appear in (previously only pypy_decl.h) |
| 217 |
|
| 218 |
* Fix tokenizer to enforce universal newlines, needed for Python 3 support |
| 219 |
|
| 220 |
.. _resolved: https://doc.pypy.org/whatsnew-5.0.0.html |
| 221 |
.. _`hypothesis`: https://hypothesis.readthedocs.org |
| 222 |
.. _`blog post`: https://morepypy.blogspot.com/2016/02/c-api-support-update.html |
| 223 |
|
| 224 |
Please update, and continue to help us make PyPy better. |
| 225 |
|
| 226 |
Cheers |
| 227 |
|
| 228 |
The PyPy Team |
| 229 |
|