[issue1675951] Performance for small reads and fix seek problem

Antoine Pitrou report at bugs.python.org
Sat Sep 18 13:35:26 CEST 2010


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

> Attached result of a run with stdlib gzip module only. Results
> indicate that performance still is as bad as on Python 2. The Python 3
> gzip module also still makes use of tell() ans seek(). So both
> argument for including this patch are still valid.

Performance is easily improved by wrapping the file object in a
io.BufferedReader or io.BufferedWriter:

Text 1 byte block test
Original gzip Write:    2.125 s Read:    0.683 s
New gzip      Write:    0.390 s Read:    0.240 s

Text 4 byte block test
Original gzip Write:    1.077 s Read:    0.351 s
New gzip      Write:    0.204 s Read:    0.132 s

Text 16 byte block test
Original gzip Write:    1.119 s Read:    0.353 s
New gzip      Write:    0.264 s Read:    0.137 s

Still, fixing the seek()/tell() issue would be nice.

----------
title: [gzip] Performance for small reads and fix seek problem -> Performance for small reads and fix seek problem

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


More information about the Python-bugs-list mailing list