Marc-Andre Lemburg <m...@egenix.com> added the comment: Alexander Belopolsky wrote: > > Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment: > > In issue11303.diff, I add similar optimization for encode('latin1') and for > 'utf8' variant of utf-8. I don't think dash-less variants of utf-16 and > utf-32 are common enough to justify special-casing.
Looks good. Given that we are starting to have a whole set of such aliases in the C code, I wonder whether it would be better to make the string comparisons more efficient, e.g. if "utf" matches, the checks could then continue with "8" or "-8" instead of trying to match "utf" again and again. ---------- title: b'x'.decode('latin1') is much slower than b'x'.decode('latin-1') -> b'x'.decode('latin1') is much slower than b'x'.decode('latin-1') _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11303> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com