mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Mention that seek and tell over a TextIOWrapper can be very slow.
This commit is contained in:
@@ -814,6 +814,8 @@ Text I/O over a binary storage (such as a file) is significantly slower than
|
||||
binary I/O over the same storage, because it implies conversions from
|
||||
unicode to binary data using a character codec. This can become noticeable
|
||||
if you handle huge amounts of text data (for example very large log files).
|
||||
Also, :meth:`TextIOWrapper.tell` and :meth:`TextIOWrapper.seek` are both
|
||||
quite slow due to the reconstruction algorithm used.
|
||||
|
||||
:class:`StringIO`, however, is a native in-memory unicode container and will
|
||||
exhibit similar speed to :class:`BytesIO`.
|
||||
|
||||
Reference in New Issue
Block a user