| 1 |
============ |
| 2 |
PyPy2.7 v5.4 |
| 3 |
============ |
| 4 |
|
| 5 |
We have released PyPy2.7 v5.4, a little under two months after PyPy2.7 v5.3. |
| 6 |
This new PyPy2.7 release includes incremental improvements to our C-API |
| 7 |
compatibility layer (cpyext), enabling us to pass over 99% of the upstream |
| 8 |
numpy test suite. We updated built-in cffi_ support to version 1.8, |
| 9 |
which now supports the "limited API" mode for c-extensions on |
| 10 |
CPython >=3.2. |
| 11 |
|
| 12 |
We improved tooling for the PyPy JIT_, and expanded VMProf |
| 13 |
support to OpenBSD and Dragon Fly BSD |
| 14 |
|
| 15 |
As always, this release fixed many issues and bugs raised by the |
| 16 |
growing community of PyPy users. We strongly recommend updating. |
| 17 |
|
| 18 |
You can download the PyPy2.7 v5.4 release here: |
| 19 |
|
| 20 |
https://pypy.org/download.html |
| 21 |
|
| 22 |
We would like to thank our donors for the continued support of the PyPy |
| 23 |
project. |
| 24 |
|
| 25 |
We would also like to thank our contributors and |
| 26 |
encourage new people to join the project. PyPy has many |
| 27 |
layers and we need help with all of them: `PyPy`_ and `RPython`_ documentation |
| 28 |
improvements, tweaking popular `modules`_ to run on pypy, or general `help`_ |
| 29 |
with making RPython's JIT even better. |
| 30 |
|
| 31 |
.. _cffi: https://cffi.readthedocs.org |
| 32 |
.. _JIT: https://morepypy.blogspot.com.au/2016/08/pypy-tooling-upgrade-jitviewer-and.html |
| 33 |
.. _`PyPy`: https://doc.pypy.org |
| 34 |
.. _`RPython`: https://rpython.readthedocs.org |
| 35 |
.. _`modules`: https://doc.pypy.org/project-ideas.html#make-more-python-modules-pypy-friendly |
| 36 |
.. _`help`: https://doc.pypy.org/project-ideas.html |
| 37 |
|
| 38 |
What is PyPy? |
| 39 |
============= |
| 40 |
|
| 41 |
PyPy is a very compliant Python interpreter, almost a drop-in replacement for |
| 42 |
CPython 2.7. It's fast (`PyPy and CPython 2.7.x`_ performance comparison) |
| 43 |
due to its integrated tracing JIT compiler. |
| 44 |
|
| 45 |
We also welcome developers of other `dynamic languages`_ to see what RPython |
| 46 |
can do for them. |
| 47 |
|
| 48 |
This release supports: |
| 49 |
|
| 50 |
* **x86** machines on most common operating systems |
| 51 |
(Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD) |
| 52 |
|
| 53 |
* newer **ARM** hardware (ARMv6 or ARMv7, with VFPv3) running Linux, |
| 54 |
|
| 55 |
* big- and little-endian variants of **PPC64** running Linux, |
| 56 |
|
| 57 |
* **s390x** running Linux |
| 58 |
|
| 59 |
.. _`PyPy and CPython 2.7.x`: https://speed.pypy.org |
| 60 |
.. _`dynamic languages`: https://pypyjs.org |
| 61 |
|
| 62 |
Other Highlights (since 5.3 released in June 2016) |
| 63 |
========================================================= |
| 64 |
|
| 65 |
* New features: |
| 66 |
|
| 67 |
* Add `sys.{get,set}dlopenflags` |
| 68 |
|
| 69 |
* Improve CPython compatibility of 'is' for small and empty strings |
| 70 |
|
| 71 |
* Support for rgc.FinalizerQueue in the Boehm garbage collector |
| 72 |
|
| 73 |
* (RPython) support spawnv() if it is called in C `_spawnv` on windows |
| 74 |
|
| 75 |
* Fill in more slots when creating a PyTypeObject from a W_TypeObject, |
| 76 |
like `__hex__`, `__sub__`, `__pow__` |
| 77 |
|
| 78 |
* Copy CPython's logic more closely for `isinstance()` and |
| 79 |
`issubclass()` as well as `type.__instancecheck__()` and |
| 80 |
`type.__subclasscheck__()` |
| 81 |
|
| 82 |
* Expose the name of CDLL objects |
| 83 |
|
| 84 |
* Rewrite the win32 dependencies of `subprocess` to use cffi |
| 85 |
instead of ctypes |
| 86 |
|
| 87 |
* Improve the `JIT logging`_ facitilities |
| 88 |
|
| 89 |
* (RPython) make int * string work |
| 90 |
|
| 91 |
* Allocate all RPython strings with one extra byte, normally |
| 92 |
unused. This now allows `ffi.from_buffer(string)` in CFFI with |
| 93 |
no copy |
| 94 |
|
| 95 |
* Adds a new commandline option `-X track-resources` that will |
| 96 |
produce a `ResourceWarning` when the GC closes a file or socket. |
| 97 |
The traceback for the place where the file or socket was allocated |
| 98 |
is given as well, which aids finding places where `close()` is |
| 99 |
missing |
| 100 |
|
| 101 |
* Add missing `PyObject_Realloc`, `PySequence_GetSlice` |
| 102 |
|
| 103 |
* `type.__dict__` now returns a `dict_proxy` object, like on CPython. |
| 104 |
Previously it returned what looked like a regular dict object (but |
| 105 |
it was already read-only) |
| 106 |
|
| 107 |
* (RPython) add `rposix.{get,set}_inheritable()`, needed by Python 3.5 |
| 108 |
|
| 109 |
* (RPython) add `rposix_scandir` portably, needed for Python 3.5 |
| 110 |
|
| 111 |
* Increased but incomplete support for memoryview attributes (format, |
| 112 |
itemsize, ...) which also adds support for `PyMemoryView_FromObject` |
| 113 |
|
| 114 |
* Bug Fixes |
| 115 |
|
| 116 |
* Reject `mkdir()` in read-only sandbox filesystems |
| 117 |
|
| 118 |
* Add include guards to pymem.h to enable c++ compilation |
| 119 |
|
| 120 |
* Fix build breakage on OpenBSD and FreeBSD |
| 121 |
|
| 122 |
* Support OpenBSD, Dragon Fly BSD in VMProf |
| 123 |
|
| 124 |
* Fix for `bytearray('').replace('a', 'ab')` for empty strings |
| 125 |
|
| 126 |
* Sync internal state before calling `PyFile_AsFile()` |
| 127 |
|
| 128 |
* Allow writing to a char* from `PyString_AsString()` until it is |
| 129 |
forced, also refactor `PyStringObject` to look like CPython's |
| 130 |
and allow subclassing `PyString_Type` and `PyUnicode_Type` |
| 131 |
|
| 132 |
* Rpython rffi's socket(2) wrapper did not preserve errno |
| 133 |
|
| 134 |
* Refactor `PyTupleObject` to look like CPython's and allow |
| 135 |
subclassing `PyTuple_Type` |
| 136 |
|
| 137 |
* Allow c-level assignment to a function pointer in a C-API |
| 138 |
user-defined type after calling PyTypeReady by retrieving |
| 139 |
a pointer to the function via offsets |
| 140 |
rather than storing the function pointer itself |
| 141 |
|
| 142 |
* Use `madvise(MADV_FREE)`, or if that doesn't exist |
| 143 |
`MADV_DONTNEED` on freed arenas to release memory back to the |
| 144 |
OS for resource monitoring |
| 145 |
|
| 146 |
* Fix overflow detection in conversion of float to 64-bit integer |
| 147 |
in timeout argument to various thread/threading primitives |
| 148 |
|
| 149 |
* Fix win32 outputting `\r\r\n` in some cases |
| 150 |
|
| 151 |
* Make `hash(-1)` return -2, as CPython does, and fix all the |
| 152 |
ancilary places this matters |
| 153 |
|
| 154 |
* Fix `PyNumber_Check()` to behave more like CPython |
| 155 |
|
| 156 |
* (VMProf) Try hard to not miss any Python-level frame in the |
| 157 |
captured stacks, even if there is metainterp or blackhole interp |
| 158 |
involved. Also fix the stacklet (greenlet) support |
| 159 |
|
| 160 |
* Fix a critical JIT bug where `raw_malloc` -equivalent functions |
| 161 |
lost the additional flags |
| 162 |
|
| 163 |
* Fix the mapdict cache for subclasses of builtin types that |
| 164 |
provide a dict |
| 165 |
|
| 166 |
* Issues reported with our previous release were resolved_ after |
| 167 |
reports from users on our issue tracker at |
| 168 |
https://bitbucket.org/pypy/pypy/issues or on IRC at #pypy |
| 169 |
|
| 170 |
* Performance improvements: |
| 171 |
|
| 172 |
* Add a before_call()-like equivalent before a few operations like |
| 173 |
`malloc_nursery`, to move values from registers into other registers |
| 174 |
instead of to the stack. |
| 175 |
|
| 176 |
* More tightly pack the stack when calling with `release gil` |
| 177 |
|
| 178 |
* Support `int_floordiv()`, `int_mod()` in the JIT more efficiently |
| 179 |
and add `rarithmetic.int_c_div()`, `rarithmetic.int_c_mod()` as |
| 180 |
explicit interfaces. Clarify that `int_floordiv()` does python-style |
| 181 |
rounding, unlike `llop.int_floordiv()`. |
| 182 |
|
| 183 |
* Use `ll_assert` (more often) in incminimark |
| 184 |
|
| 185 |
* (Testing) Simplify handling of interp-level tests and make it |
| 186 |
more forward-compatible. Don't use interp-level RPython |
| 187 |
machinery to test building app-level extensions in cpyext |
| 188 |
|
| 189 |
* Constant-fold `ffi.offsetof("structname", "fieldname")` in cffi |
| 190 |
backend |
| 191 |
|
| 192 |
* Avoid a case in the JIT, where successive guard failures in |
| 193 |
the same Python function end up as successive levels of |
| 194 |
RPython functions, eventually exhausting the stack, while at |
| 195 |
app-level the traceback is very short |
| 196 |
|
| 197 |
* Check for NULL returns from calls to the raw-malloc and raise, |
| 198 |
rather than a guard |
| 199 |
|
| 200 |
* Improve `socket.recvfrom()` so that it copies less if possible |
| 201 |
|
| 202 |
* When generating C code, inline `goto` to blocks with only one |
| 203 |
predecessor, generating less lines of code |
| 204 |
|
| 205 |
* When running the final backend-optimization phase before emitting |
| 206 |
C code, constant-fold calls to we_are_jitted to return False. This |
| 207 |
makes the generated C code a few percent smaller |
| 208 |
|
| 209 |
* Refactor the `uid_t/gid_t` handling in `rlib.rposix` and in |
| 210 |
`interp_posix.py`, based on the clean-up of CPython 2.7.x |
| 211 |
|
| 212 |
.. _`JIT logging`: https://morepypy.blogspot.com/2016/08/pypy-tooling-upgrade-jitviewer-and.html |
| 213 |
.. _resolved: https://doc.pypy.org/whatsnew-5.4.0.html |
| 214 |
|
| 215 |
Please update, and continue to help us make PyPy better. |
| 216 |
|
| 217 |
Cheers |