[issue3873] Unpickling is really slow

Antoine Pitrou 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>
<http://bugs.python.org/issue3873>
_______________________________________


More information about the Python-bugs-list mailing list