On Friday 02 August 2002 02:16 am, Pierre Baillet wrote:

> Using sysread is much faster than any other read i could experience
> in ruby. Then you can split this file using :split (although i'm
> not sure it is the fastest way to do that). Here are my results:
>

Under 1.7.2, it looks like readlines() is faster:

$ time ruby -e 'a=File.open("bigfile").sysread(4194304).split("\n")'

real    0m0.328s
user    0m0.230s
sys     0m0.080s

$ time ruby -e "a=IO.readlines('bigfile')"

real    0m0.156s
user    0m0.130s
sys     0m0.010s

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE