On Tue, Jan 02, 2001 at 09:56:40AM -0500, Guido van Rossum wrote: > Now what to do? I still don't like xreadlines very much, but I do see > that it can save some time. But my test doesn't confirm Neel's times > as posted by Tim: > > > Slowest: for line in fileinput.input('foo'): # Time 100 > > : while 1: line = file.readline() # Time 75 > > : for line in LinesOf(open('foo')): # Time 25 > > Fastest: for line in file.readlines(): # Time 10 > > while 1: lines = file.readlines(hint) # Time 10 > > for line in xreadlines(file): # Time 10 > > I only see a factor of 3 between fastest and slowest, and > readline is only about 60% slower than readlines_sizehint. Could it be that your using the CVS version of Python which includes Andrew's cool glibc getline enhancement? Neil
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4