[issue3873] Unpickling is really slow

Antoine Pitrou report at bugs.python.org
Tue Sep 28 00:23:15 CEST 2010


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

Here is a patch using peek() rather than seek(). There are some inefficiencies around (such as using read() to skip the consumed prefetched bytes), but the benchmark results are still as good as with seek():

Protocol 0
- dump: 142.5 ms
- load (seekable=False): 598.8 ms
- load (seekable=True): 240.2 ms

Protocol 1
- dump: 28.9 ms
- load (seekable=False): 253.2 ms
- load (seekable=True): 25.7 ms

Protocol 2
- dump: 28.9 ms
- load (seekable=False): 253.3 ms
- load (seekable=True): 25.7 ms

----------
Added file: http://bugs.python.org/file19034/unpickleprefetch3.patch

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


More information about the Python-bugs-list mailing list