[Python-Dev] OT: A Day in the Life of p5p

Greg Stein gstein@lyra.org
Wed, 28 Jun 2000 14:03:42 -0700


On Wed, Jun 28, 2000 at 10:42:56PM +0200, Fredrik Lundh wrote:
> tim wrote:
> > Against that, line-at-a-time text file input in particular is something that
> > every newbie bumps into at once, and Perl does have a monster advantage
> > there (at least 2x faster, probably closer to 3 on most platforms).
> 
> and 2-3x is what you get if you replace readline with readlines,
> as described in this note:
> http://w1.132.telia.com/~u13208596/notes/readline-performance.htm
> 
> it would be very nice if the file object could do something similar
> internally (only in text mode, perhaps).  maybe in 1.7?

That could be troublesome. It should only be done if the file is seekable so
that you can rewind. If a readline() on (say) a socket moved you *past* the
newline, then you could be in big trouble. Or what happens in said socket is
blocking? etc.

Now... please don't start a thread about this now. Wait for post 1.6. Maybe
I'm totally off, and some smart guy here can say so. But it just doesn't
matter, so I'd rather not have to read a whole thread on the stuff :-)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/