New submission from Volker Siepmann <[email protected]>:

The readline() function in zipfile (in ZipExtFile) reads chunks of max
100 bytes (zipfile.py, line 525) into the linebuffer. A file of 500
MBytes therefore yields 5 million chunks.
Changing the value 100 to 10000 bytes boosts performance by magnitudes,
while it only requires 10k of memory.

My fix in zipfile.py, line 525:

buf = self.read(min(size, 10000)) # was 100 before

Best regards / Volker Siepmann

----------
components: Library (Lib)
messages: 94545
nosy: volker_siepmann
severity: normal
status: open
title: low performance of zipfile readline()
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue7216>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to