STINNER Victor added the comment: - while (pos<end && Py_ISDIGIT(PyUnicode_READ_CHAR(s, pos))) + while (pos<end && Py_ISDIGIT(PyUnicode_READ(ukind, udata, pos)))
Great change. It's really bad for performance to use such inefficient macro in a loop: PyUnicode_READ_CHAR() uses 2 nested "if" :-/ faster_format.patch LGTM except of Serhiy's comment. To get best performances, it's even better to specialize Unicode code to have 4 versions: ascii, latin1, ucs2, ucs4. The "stringlib" does that using C "templates". ---------- nosy: +haypo _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27818> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com