[issue25399] Optimize bytearray % args

2015-10-14 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue25399] Optimize bytearray % args

2015-10-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 03646293f1b3 by Victor Stinner in branch 'default': Fix long_format_binary() https://hg.python.org/cpython/rev/03646293f1b3 New changeset 6fe0050a2f52 by Victor Stinner in branch 'default': Add use_bytearray attribute to _PyBytesWriter https://hg.py

[issue25399] Optimize bytearray % args

2015-10-14 Thread STINNER Victor
STINNER Victor added the comment: Microbenchmark result below. Most operations are now between 2.5 and 5 times faster. %f is as-fast, probably because formatting a float is more expensive than copying bytes (raw estimation: 150 ns to format a single floating pointer number). Common platform:

[issue25399] Optimize bytearray % args

2015-10-13 Thread STINNER Victor
New submission from STINNER Victor: Optimize bytearray % args Don't create temporary bytes objects: modify _PyBytes_Format() to create work directly on bytearray objects. * _PyBytesWriter: add use_bytearray attribute to use a bytearray buffer * Rename _PyBytes_Format() to _PyBytes_FormatEx() ju