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() just in case if something outside CPython uses it * _PyBytes_FormatEx() now uses (char*, Py_ssize_t) for the input string, so bytearray_format() doesn't need tot create a temporary input bytes object * Add use_bytearray parameter to _PyBytes_FormatEx() which is passed to _PyBytesWriter, to create a bytearray buffer instead of a bytes buffer ---------- files: bytearray_format.patch keywords: patch messages: 252970 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: Optimize bytearray % args type: performance versions: Python 3.6 Added file: http://bugs.python.org/file40776/bytearray_format.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25399> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com