[issue11114] TextIOWrapper.tell extremely slow

Antoine Pitrou report at bugs.python.org
Fri Feb 4 19:20:00 CET 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

> Here is a proof-of-concept patch for the pure Python version of
> TextIOWrapper.tell(). It turns the O(CHUNK_SIZE) operation into an
> O(1) operation most of time (still O(CHUNK_SIZE) worst-case - weird
> decoders and/or crazy input).

Actually, that's wrong. The patch is still O(CHUNK_SIZE) but with a
vastly different multiplier (and, optimistically, much smaller, as
common codecs are codecs in C).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11114>
_______________________________________


More information about the Python-bugs-list mailing list