diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-10-09 11:48:06 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-10-09 11:48:06 +0200 |
commit | fa7762ec066aa3632a25b6a52bb7597b8f17c2f3 (patch) | |
tree | 9f14bcc1d8c0f316c5e9f5dcc549686fff42340b /Python/_warnings.c | |
parent | bd5f0e8c1cf633a238c10e1d3199c0d572a4df1d (diff) | |
download | cpython-git-fa7762ec066aa3632a25b6a52bb7597b8f17c2f3.tar.gz |
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 'Python/_warnings.c')
0 files changed, 0 insertions, 0 deletions