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