[Python-Dev] Re: _PyBytesWriter/_PyUnicodeWriter could be faster

2020-10-28 Thread Ma Lin
Thanks for your very informative reply. I replied you in issue41486. Maybe memory blocks will not bring performance improvement to _PyBytesWriter/_PyUnicodeWriter, which is a bit frustrating. > For a+b, Python first computes "a", then "b", and finally "a+b". I don't see > how your API could opt

[Python-Dev] Re: _PyBytesWriter/_PyUnicodeWriter could be faster

2020-10-26 Thread Victor Stinner
Hi, Le dim. 25 oct. 2020 à 15:36, Ma Lin a écrit : > Some code needs to maintain an output buffer that has an unpredictable size. > Such as bz2/lzma/zlib modules, _PyBytesWriter/_PyUnicodeWriter. > > In current code, when the output buffer grows, resizing will cause > unnecessary memcpy(). > >