Debian Codegraph @

pypy/doc/release-v5.7.0.rst

raw
1 =============================================
2 PyPy2.7 and PyPy3.5 v5.7 - two in one release
3 =============================================
4
5 The PyPy team is proud to release both PyPy2.7 v5.7 (an interpreter supporting
6 Python v2.7 syntax), and a beta-quality PyPy3.5 v5.7 (an interpreter for Python
7 v3.5 syntax). The two releases are both based on much the same codebase, thus
8 the dual release. Note that PyPy3.5 supports Linux 64bit only for now.
9
10 This new PyPy2.7 release includes the upstream stdlib version 2.7.13, and
11 PyPy3.5 (our first in the 3.5 series) includes the upstream stdlib version
12 3.5.3.
13
14 We continue to make incremental improvements to our C-API
15 compatibility layer (cpyext). PyPy2 can now import and run many C-extension
16 packages, among the most notable are Numpy, Cython, and Pandas. Performance may
17 be slower than CPython, especially for frequently-called short C functions.
18 Please let us know if your use case is slow, we have ideas how to make things
19 faster but need real-world examples (not micro-benchmarks) of problematic code.
20
21 Work proceeds at a good pace on the PyPy3.5
22 version due to a grant_ from the Mozilla Foundation, hence our first 3.5.3 beta
23 release. Thanks Mozilla !!! While we do not pass all tests yet, asyncio works and
24 as `these benchmarks show`_ it already gives a nice speed bump.
25 We also backported the ``f""`` formatting from 3.6 (as an exception; otherwise
26 "PyPy3.5" supports the Python 3.5 language).
27
28 CFFI_ has been updated to 1.10, improving an already great package for
29 interfacing with C.
30
31 We now use shadowstack as our default gcrootfinder_ even on Linux. The
32 alternative, asmgcc, will be deprecated at some future point. While about 3%
33 slower, shadowstack is much more easily maintained and debuggable. Also,
34 the performance of shadowstack has been improved in general: this should
35 close the speed gap between Linux and other platforms.
36
37 As always, this release fixed many issues and bugs raised by the
38 growing community of PyPy users. We strongly recommend updating.
39
40 You can download the v5.7 release here:
41
42 https://pypy.org/download.html
43
44 We would like to thank our donors for the continued support of the PyPy
45 project.
46
47 We would also like to thank our contributors and
48 encourage new people to join the project. PyPy has many
49 layers and we need help with all of them: `PyPy`_ and `RPython`_ documentation
50 improvements, tweaking popular `modules`_ to run on pypy, or general `help`_
51 with making RPython's JIT even better.
52
53 .. _CFFI: https://cffi.readthedocs.io/en/latest/whatsnew.html
54 .. _grant: https://morepypy.blogspot.com/2016/08/pypy-gets-funding-from-mozilla-for.html
55 .. _`PyPy`: index.html
56 .. _`RPython`: https://rpython.readthedocs.org
57 .. _`modules`: project-ideas.html#make-more-python-modules-pypy-friendly
58 .. _`help`: project-ideas.html
59 .. _`these benchmarks show`: https://morepypy.blogspot.com/2017/03/async-http-benchmarks-on-pypy3.html
60 .. _gcrootfinder: config/translation.gcrootfinder.html
61
62 What is PyPy?
63 =============
64
65 PyPy is a very compliant Python interpreter, almost a drop-in replacement for
66 CPython 2.7 and CPython 3.5. It's fast (`PyPy and CPython 2.7.x`_ performance comparison)
67 due to its integrated tracing JIT compiler.
68
69 We also welcome developers of other `dynamic languages`_ to see what RPython
70 can do for them.
71
72 The PyPy 2.7 release supports:
73
74 * **x86** machines on most common operating systems
75 (Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD)
76
77 * newer **ARM** hardware (ARMv6 or ARMv7, with VFPv3) running Linux,
78
79 * big- and little-endian variants of **PPC64** running Linux,
80
81 * **s390x** running Linux
82
83 .. _`PyPy and CPython 2.7.x`: https://speed.pypy.org
84 .. _`dynamic languages`: https://rpython.readthedocs.io/en/latest/examples.html
85
86 Highlights of the PyPy2.7, cpyext, and RPython changes (since 5.6 released Nov, 2016)
87 =====================================================================================
88
89 See also issues that were resolved_
90
91 * New features and cleanups
92
93 * update the format of the PYPYLOG file and improvements to vmprof
94 * emit more sysconfig values for downstream cextension packages including
95 properly setting purelib and platlib to site-packages
96 * add ``PyAnySet_Check``, ``PyModule_GetName``, ``PyWeakref_Check*``,
97 ``_PyImport_{Acquire,Release}Lock``, ``PyGen_Check*``, ``PyOS_AfterFork``,
98 * detect and raise on recreation of a PyPy object from a PyObject during
99 tp_dealloc
100 * refactor and clean up poor handling of unicode exposed in work on py3.5
101 * builtin module cppyy_ supports C++ 11, 14, etc. via cling (reflex has been removed)
102 * adapt ``weakref`` according to CPython issue 19542_, will be in CPython 2.7.14
103 * support translations with cpyext and the Boehm GC (for special cases like
104 RevDB_
105 * implement ``StringBuffer.get_raw_address`` for the buffer protocol, it is
106 now possible to obtain the address of any readonly object without pinning it
107 * refactor the initialization code in translating cpyext
108 * use a cffi-style C parser to create rffi objects in cpyext, now the
109 translating Python must have either ``cffi`` or ``pycparser`` available
110 * implement ``move_to_end(last=True/False)`` on RPython ordered dicts, make
111 available as ``__pypy__.move_to_end`` and, on py3.5,
112 ``OrderedDict.move_to_end()``
113 * remove completely RPython ``space.wrap`` in a major cleanup, differentiate
114 between ``space.newtext`` and ``space.newbytes`` on py3.5
115 * any uncaught RPython exception in the interpreter is turned into a
116 SystemError (rather than a segfault)
117 * add translation time --disable_entrypoints option for embedding PyPy together
118 with another RPython VM
119
120
121 * Bug Fixes
122
123 * fix ``"".replace("", "x", num)`` to give the same result as CPython
124 * create log files without the executable bit
125 * disable ``clock_gettime()`` on OS/X, since we support 10.11 and it was only
126 added in 10.12
127 * support ``HAVE_FSTATVFS`` which was unintentionally always false
128 * fix user-created C-API heaptype, issue 2434_
129 * fix ``PyDict_Update`` is not actually the same as ``dict.update``
130 * assign ``tp_doc`` on ``PyTypeObject`` and tie it to the app-level ``__doc__`` attribute
131 issue 2446_
132 * clean up memory leaks around ``PyObject_GetBuffer``, ``PyMemoryView_GET_BUFFER``,
133 ``PyMemoryView_FromBuffer``, and ``PyBuffer_Release``
134 * improve support for creating C-extension objects from app-level classes,
135 filling more slots, especially ``tp_new`` and ``tp_dealloc``
136 * fix for ``ctypes.c_bool`` returning ``bool`` restype, issue 2475_
137 * fix in corner cases with the GIL and C-API functions
138 * allow overriding thread.local.__init__ in a subclass, issue 2501_
139 * allow ``PyClass_New`` to be called with NULL as the first argument, issue 2504_
140
141
142 * Performance improvements:
143
144 * clean-ups in the jit optimizeopt
145 * optimize ``if x is not None: return x`` or ``if x != 0: return x``
146 * add ``jit.conditional_call_elidable()``, a way to tell the JIT
147 "conditionally call this function" returning a result
148 * try harder to propagate ``can_be_None=False`` information
149 * add ``rarithmetic.ovfcheck_int32_add/sub/mul``
150 * add and use ``rgc.may_ignore_finalizer()``: an optimization hint that makes
151 the GC stop tracking the object
152 * replace malloc+memset with a single calloc, useful for large allocations?
153 * linux: try to implement os.urandom() as the syscall getrandom() if available
154 * propagate ``debug.ll_assert_not_none()`` through the JIT to reduce number of
155 guards
156 * improve the performance of ``PyDict_Next``
157 * improve ``dict.pop()``
158 * improve the optimization of branchy Python code by retaining more
159 information across failing guards
160 * add optimized "zero-copy" path for ``io.FileIO.readinto``
161
162 * RPython improvements
163
164 * improve the consistency of RPython annotation unions
165 * add translation option --keepgoing to continue after the first AnnotationError
166 * improve shadowstack to where it is now the default in place of asmgcc
167 * add a rpython implementation of siphash24, allow choosing hash algorithm
168 randomizing the seed
169 * add rstack.stack_almost_full() and use it to avoid stack overflow due to
170 the JIT where possible
171
172 Highlights of the PyPy3.5 release (since 5.5 alpha released Oct, 2016)
173 ==========================================================================
174
175 Development moved from the py3k branch to the py3.5 branch in the PyPy bitbucket repo.
176
177 * New features
178
179 * this first PyPy3.5 release implements most of Python 3.5.3, exceptions are listed below
180 * PEP 456 allowing secure and interchangeable hash algorithms
181 * use cryptography_'s cffi backend for SSL
182
183
184 * Bug Fixes
185
186 * implement fixes for some CPython issues that arose since the last release
187 * solve deadlocks in thread locking mechanism
188
189 * Performance improvements:
190
191 * do not create a list whenever ``descr_new`` of a ``bytesobject`` is called
192
193 * The following features of Python 3.5 are not implemented yet in PyPy:
194
195 * PEP 442: Safe object finalization
196 * PEP 489: Multi-phase extension module initialization
197
198 .. _resolved: whatsnew-pypy2-5.7.0.html
199 .. _19542: https://bugs.python.org/issue19542
200 .. _2434: https://bitbucket.org/pypy/pypy/issues/2434/support-pybind11-in-conjunction-with-pypys
201 .. _2446: https://bitbucket.org/pypy/pypy/issues/2446/cpyext-tp_doc-field-not-reflected-on
202 .. _2475: https://bitbucket.org/pypy/pypy/issues/2475
203 .. _2501: https://bitbucket.org/pypy/pypy/issues/2501
204 .. _2504: https://bitbucket.org/pypy/pypy/issues/2504
205 .. _RevDB: https://bitbucket.org/pypy/revdb
206 .. _cryptography: https://cryptography.io
207 .. _cppyy: cppyy.html
208
209 Please update, and continue to help us make PyPy better.
210
211 Cheers