|-> Re: 152 is faster that 221 ? I think not ...

Dave Harrison dlharris at mail.usyd.edu.au
Tue Aug 28 07:10:31 EDT 2001


Thus spake Dave Harrison (dlharris at mail.usyd.edu.au):

> Im writing a script that goes through and reads zipped log.  So far so cool.
> 
> Now the current install on the server is 1.5.2 which is nice, but I was hoping 2.2.1 would be faster at reading the logs by virtue of xreadlines and general tweaking over time.
> 
> But to my surprise and mild horror 1.5.2 was clocking horrendously faster than 2.2.1 ....
> 
> Whats the deal ? It may be something basic Im overlooking but I cant see why 2.2.1 should not at least be the same speed as 1.5.2.
> 
> My basic timing code is as follows :
> 
> 
> -------------------------------------------
> import gzip, time
> list = []
> file = gzip.open('20010615.gz')
> start = time.clock()
> for line in file.readlines():
>         list.append(line)
> stop = time.clock()
> total = stop - start
> print
> print '1.5.2 Running Time : '+str(total)
> print
> -------------------------------------------

> 1.5.2 -> 3 seconds or so
> 2.2.1 -> 13 seconds or so
> 
> Help ?
> 
> Dave
> 


Ok further to my previous post I have now run exactly the same piece of code through both the 1.5.2 interp and the 2.2a1 interp and the speed difference still remains with 1.5.2 a good 9-10 seconds ahead of 2.2a1.

Suggestions ?
Dave




More information about the Python-list mailing list