diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-10-09 09:48:06 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-10-09 09:48:06 (GMT) |
commit | fa7762ec066aa3632a25b6a52bb7597b8f17c2f3 (patch) | |
tree | 9f14bcc1d8c0f316c5e9f5dcc549686fff42340b /Misc | |
parent | bd5f0e8c1cf633a238c10e1d3199c0d572a4df1d (diff) | |
download | cpython-fa7762ec066aa3632a25b6a52bb7597b8f17c2f3.zip cpython-fa7762ec066aa3632a25b6a52bb7597b8f17c2f3.tar.gz cpython-fa7762ec066aa3632a25b6a52bb7597b8f17c2f3.tar.bz2 |
Issue #25349: Optimize bytes % args using the new private _PyBytesWriter API
* Thanks to the _PyBytesWriter API, output smaller than 512 bytes are allocated
on the stack and so avoid calling _PyBytes_Resize(). Because of that, change
the default buffer size to fmtcnt instead of fmtcnt+100.
* Rely on _PyBytesWriter algorithm to overallocate the buffer instead of using
a custom code. For example, _PyBytesWriter uses a different overallocation
factor (25% or 50%) depending on the platform to get best performances.
* Disable overallocation for the last write.
* Replace C loops to fill characters with memset()
* Add also many comments to _PyBytes_Format()
* Remove unused FORMATBUFLEN constant
* Avoid the creation of a temporary bytes object when formatting a floating
point number (when no custom formatting option is used)
* Fix also reference leaks on error handling
* Use Py_MEMCPY() to copy bytes between two formatters (%)
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -10,6 +10,8 @@ Release date: XXXX-XX-XX Core and Builtins ----------------- +- Issue #25349: Optimize bytes % args using the new private _PyBytesWriter API. + - Issue #24806: Prevent builtin types that are not allowed to be subclassed from being subclassed through multiple inheritance. |