Python vs. Java gzip performance

"Martin v. Löwis" martin at v.loewis.de
Wed Mar 22 13:14:09 EST 2006


Felipe Almeida Lessa wrote:
> def readlines(self, sizehint=None):
> 	if sizehint is None:
> 		return self.read().splitlines(True)
> 	# ...
> 
> Is it okay? Or is there any embedded problem I couldn't see?

It's dangerous, if the file is really large - it might exhaust
your memory. Such a setting shouldn't be the default.

Somebody should research what blocking size works best for zipfiles,
and then compare that in performance to "read it all at once".

It would be good if the rationale for using at most 100 bytes at
a time could be discovered.

Regards,
Martin




More information about the Python-list mailing list