Author: Manuel Jacob <m...@manueljacob.de> Branch: py3.5 Changeset: r91510:2bc0ce15d8d0 Date: 2017-06-04 14:39 +0200 http://bitbucket.org/pypy/pypy/changeset/2bc0ce15d8d0/
Log: hg merge default diff --git a/pypy/doc/release-v5.8.0.rst b/pypy/doc/release-v5.8.0.rst --- a/pypy/doc/release-v5.8.0.rst +++ b/pypy/doc/release-v5.8.0.rst @@ -8,25 +8,23 @@ the dual release. Note that PyPy3.5 supports Linux 64bit only for now. This new PyPy2.7 release includes the upstream stdlib version 2.7.13, and -PyPy3.5 (our first in the 3.5 series) includes the upstream stdlib version -3.5.3. +PyPy3.5 includes the upstream stdlib version 3.5.3. -We continue to make incremental improvements to our C-API -compatibility layer (cpyext). PyPy2 can now import and run many C-extension -packages, among the most notable are Numpy, Cython, and Pandas. Performance may -be slower than CPython, especially for frequently-called short C functions. +This release enables `profile guided optimization` of the base interpreter, +which may make unjitted code run faster. + Please let us know if your use case is slow, we have ideas how to make things faster but need real-world examples (not micro-benchmarks) of problematic code. Work proceeds at a good pace on the PyPy3.5 -version due to a grant_ from the Mozilla Foundation, hence our first 3.5.3 beta +version due to a grant_ from the Mozilla Foundation, hence our 3.5.3 beta release. Thanks Mozilla !!! While we do not pass all tests yet, asyncio works and as `these benchmarks show`_ it already gives a nice speed bump. We also backported the ``f""`` formatting from 3.6 (as an exception; otherwise "PyPy3.5" supports the Python 3.5 language). -CFFI_ has been updated to 1.10, improving an already great package for -interfacing with C. +CFFI_, which is part of the PyPy release, has been updated to an unreleased 1.10.1, +improving an already great package for interfacing with C. As always, this release fixed many issues and bugs raised by the growing community of PyPy users. We strongly recommend updating. @@ -44,6 +42,7 @@ improvements, tweaking popular `modules`_ to run on pypy, or general `help`_ with making RPython's JIT even better. +.. _`profile guided optimization`: https://pythonfiles.wordpress.com/2017/05/12/enabling-profile-guided-optimizations-for-pypy .. _CFFI: https://cffi.readthedocs.io/en/latest/whatsnew.html .. _grant: https://morepypy.blogspot.com/2016/08/pypy-gets-funding-from-mozilla-for.html .. _`PyPy`: index.html @@ -81,28 +80,52 @@ See also issues that were resolved_ +Note that these are also merged into PyPy 3.5 + * New features and cleanups - * Implement PyModule_New, + * Implement PyModule_New, Py_GetRecursionLimit, Py_SetRecursionLimit, + Py_EnterRecursiveCall, Py_LeaveRecursiveCall, populate tp_descr_get and + tp_descr_set slots, + add conversions of ``__len__``, ``__setitem__``, ``__delitem__`` to + appropriate C-API slots * Fix for multiple inheritance in app-level for C-API defined classes * Revert a change that removed tp_getattr (Part of the 5.7.1 bugfix release) * Document more differences with CPython here_ * Add native PyPy support to profile frames in vmprof * Fix an issue with Exception order on failed import * Fix for a corner case of __future__ imports + * Update packaged Windows zlib, sqlite, expat and OpenSSL to versions used + by CPython + * Allow windows builds to use ``jom.exe`` for compiling in parallel + * Rewrite ``itertools.groupby()``, following CPython + * Backport changes from PyPy 3.5 to minimize the code differences + * Improve support for BSD using patches contributed by downstream + * Support profile-guided optimization, enabled with --profopt, , and + specify training data ``profoptpath`` -* Bug Fixes +* Bug Fixes * Correctly handle dict.pop where the popping key is not the same type as the dict's and pop is called with a default (Part of the 5.7.1 bugfix release) * Improve our file's universal newline .readline implementation for ``\n``, ``\r`` confusion + * Tweak issue where ctype array ``_base`` was set on empty arrays, now it + is closer to the implementation in CPython + * Fix critical bugs in shadowstack that crashed multithreaded programs and + very rarely showed up even in single threaded programs + * Remove flaky fastpath function call from ctypes + * Support passing a buffersize of 0 to socket.getsockopt + * Avoid hash() returning -1 in cpyext * Performance improvements: * Tweaks made to improve performance by reducing the number of guards inserted in jitted code, based on feedback from users * Add garbage collector memory pressure to some c-level allocations + * Speed up struck.pack, struck.pack_into + * Performance tweaks to round(x, n) for the case n == 0 + * Improve zipfile performance by not doing repeated string concatenation * RPython improvements @@ -119,6 +142,11 @@ blocks are moved off-line. Also, the temporary register used to contain large constants is reused across instructions. This helps CPUs branch predictor + * Refactor rpython.rtyper.controllerentry to use use ``@specialize`` instead + of ``._annspecialcase_`` + * Refactor handling of buffers and memoryviews. Memoryviews will now be + accepted in a few more places, e.g. in compile() + .. _here: http://rpython.readthedocs.io/en/latest/cpython_differences.html @@ -129,6 +157,15 @@ * Implement main part of PEP 489 (multi-phase extension module initialization) * Add docstrings to various modules and functions + * Adapt many CPython bug/feature fixes from CPython 3.5 to PyPy3.5 + * Translation succeeds on Mac OS X, unfortunately our buildbot slave cannot + be updated to the proper development versions of OpenSSL to properly + package a release. + * Implement `` _SSLSocket.server_side`` + * Do not silently ignore ``_swappedbytes_`` in ctypes. We now raise a + ``NotImplementedError`` + * Implement and expose ``msvcrt.SetErrorMode`` + * Implement ``PyModule_GetState`` * Bug Fixes @@ -137,12 +174,21 @@ * OSError(None,None) is different from OSError() * Get closer to supporting 32 bit windows, translation now succeeds and most lib-python/3/test runs + * Call ``sys.__interactivehook__`` at startup + * Let ``OrderedDict.__init__`` behave like CPython wrt. subclasses + overridding ``__setitem__`` * Performance improvements: * Use "<python> -m test" to run the CPython test suite, as documented by CPython, instead of our outdated regrverbose.py script * Change _cffi_src/openssl/callbacks.py to stop relying on the CPython C API. + * Avoid importing the full locale module during _io initialization, + CPython change fbbf8b160e8d + * Avoid freezing many app-level modules at translation, avoid importing many + modules at startup + * Refactor buffers, which allows an optimization for + ``bytearray()[:n].tobytes()`` * The following features of Python 3.5 are not implemented yet in PyPy: diff --git a/pypy/module/__pypy__/interp_builders.py b/pypy/module/__pypy__/interp_builders.py --- a/pypy/module/__pypy__/interp_builders.py +++ b/pypy/module/__pypy__/interp_builders.py @@ -18,31 +18,25 @@ else: self.builder = builder_cls(size) - def _check_done(self, space): - if self.builder is None: - raise oefmt(space.w_ValueError, - "Can't operate on a built builder") - @unwrap_spec(size=int) def descr__new__(space, w_subtype, size=-1): return W_Builder(space, size) @unwrap_spec(s=unwrap) def descr_append(self, space, s): - self._check_done(space) self.builder.append(s) @unwrap_spec(s=unwrap, start=int, end=int) def descr_append_slice(self, space, s, start, end): - self._check_done(space) if not 0 <= start <= end <= len(s): raise oefmt(space.w_ValueError, "bad start/stop") self.builder.append_slice(s, start, end) def descr_build(self, space): - self._check_done(space) s = self.builder.build() - self.builder = None + # after build(), we can continue to append more strings + # to the same builder. This is supported since + # 2ff5087aca28 in RPython. if strtype is str: return space.newbytes(s) else: diff --git a/pypy/module/__pypy__/test/test_builders.py b/pypy/module/__pypy__/test/test_builders.py --- a/pypy/module/__pypy__/test/test_builders.py +++ b/pypy/module/__pypy__/test/test_builders.py @@ -9,8 +9,9 @@ b.append("1") s = b.build() assert s == "abc1231" - raises(ValueError, b.build) - raises(ValueError, b.append, "123") + assert b.build() == s + b.append("123") + assert b.build() == s + "123" def test_preallocate(self): from __pypy__.builders import StringBuilder @@ -27,7 +28,8 @@ raises(ValueError, b.append_slice, "1", 2, 1) s = b.build() assert s == "cde" - raises(ValueError, b.append_slice, "abc", 1, 2) + b.append_slice("abc", 1, 2) + assert b.build() == "cdeb" def test_stringbuilder(self): from __pypy__.builders import BytesBuilder @@ -37,6 +39,6 @@ assert len(b) == 6 b.append(b"you and me") s = b.build() - raises(ValueError, len, b) + assert len(b) == 16 assert s == b"abc123you and me" - raises(ValueError, b.build) + assert b.build() == s diff --git a/rpython/jit/backend/x86/test/test_runner.py b/rpython/jit/backend/x86/test/test_runner.py --- a/rpython/jit/backend/x86/test/test_runner.py +++ b/rpython/jit/backend/x86/test/test_runner.py @@ -33,7 +33,7 @@ add_loop_instructions = ('mov; ' 'lea; ' # a nop, for the label 'add; test; je; jmp;') # plus some padding - bridge_loop_instructions = 'cmp; jge; mov; mov; call; jmp;' + bridge_loop_instructions = 'cmp; jl; jmp;' else: add_loop_instructions = ('mov; ' 'nop; ' # for the label _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit