Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eefb97c

Browse files
committed
Mention that seek and tell over a TextIOWrapper can be very slow.
1 parent d77520a commit eefb97c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Doc/library/io.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,8 @@ Text I/O over a binary storage (such as a file) is significantly slower than
814814
binary I/O over the same storage, because it implies conversions from
815815
unicode to binary data using a character codec. This can become noticeable
816816
if you handle huge amounts of text data (for example very large log files).
817+
Also, :meth:`TextIOWrapper.tell` and :meth:`TextIOWrapper.seek` are both
818+
quite slow due to the reconstruction algorithm used.
817819

818820
:class:`StringIO`, however, is a native in-memory unicode container and will
819821
exhibit similar speed to :class:`BytesIO`.

0 commit comments

Comments
 (0)