• Victor Stinner's avatar
    Issue #16147: Rewrite PyUnicode_FromFormatV() to use _PyUnicodeWriter API · e215d960
    Victor Stinner yazdı
     * Simplify the code: replace 4 steps with one unique step using the
       _PyUnicodeWriter API. PyUnicode_Format() has the same design. It avoids to
       store intermediate results which require to allocate an array of pointers on
       the heap.
     * Use the _PyUnicodeWriter API for speed (and its convinient API):
       overallocate the buffer to reduce the number of "realloc()"
     * Implement "width" and "precision" in Python, don't rely on sprintf(). It
       avoids to need of a temporary buffer allocated on the heap: only use a small
       buffer allocated in the stack.
     * Add _PyUnicodeWriter_WriteCstr() function
     * Split PyUnicode_FromFormatV() into two functions: add
       unicode_fromformat_arg().
     * Inline parse_format_flags(): the format of an argument is now only parsed
       once, it's no more needed to have a subfunction.
     * Optimize PyUnicode_FromFormatV() for characters between two "%" arguments:
       search the next "%" and copy the substring in one chunk, instead of copying
       character per character.
    e215d960
Adı
Son kayıt (commit)
Son güncelleme
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
Tools Loading commit data...
.bzrignore Loading commit data...
.gitignore Loading commit data...
.hgeol Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
.hgtouch Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...