Python vs. Java gzip performance

Felipe Almeida Lessa felipe.lessa at gmail.com
Wed Mar 22 06:57:31 EST 2006


Em Qua, 2006-03-22 às 00:47 +0100, "Martin v. Löwis" escreveu:
> Caleb Hattingh wrote:
> > What does ".readlines()" do differently that makes it so much slower
> > than ".read().splitlines(True)"?  To me, the "one obvious way to do it"
> > is ".readlines()".
[snip]
> Anyway, decompressing the entire file at one lets zlib operate at the
> highest efficiency.

Then there should be a fast-path on readlines like this:

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?

-- 
Felipe.




More information about the Python-list mailing list