[issue3873] Unpickling is really slow
report at bugs.python.org
Mon Sep 27 22:52:16 CEST 2010
Antoine Pitrou <pitrou at free.fr> added the comment:
One problem with the seek() approach is that some file-like objects have expensive seeks. One example is GzipFile, where seek(n) is O(n) (it first rewinds to the start of file, then reads n decompressed bytes). In the end, unpickling from a GzipFile becomes O(n**2).
I will try to use peek() instead.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list