A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-January/011275.html below:

[Patches] [Patch #102915] xreadlines : readlines :: xrange : range

[Python-Dev] RE: [Patches] [Patch #102915] xreadlines : readlines :: xrange : range [Python-Dev] RE: [Patches] [Patch #102915] xreadlines : readlines :: xrange : rangeNeil Schemenauer nas@arctrix.com
Tue, 2 Jan 2001 00:42:30 -0800
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