From: nobu.nokada@... Date: 2002-03-07T22:48:04+09:00 Subject: Re: file reading impossibly slow? Hi, At Thu, 7 Mar 2002 21:18:40 +0900, Ron Jeffries wrote: > So I'm doing this benchmark to work with my set program. Part of the problem is > to read a six million record file. So I built one, six million 64-byte lines > plus newline, didn't seem to take that long. Then I decided to time how long it > would take to read, with this program: IO in ruby 1.6 is slow. And you look run it under Windows, 1.6 mswin/mingw is *VERY* slow. Try with 1.7. > I let it run for 20 minutes with no output. (A tiny file works fine.) I tried > the same program using read(65000) instead of gets, just to see if the line size > was the problem. I stopped it after 20 minutes also. In 1.7, IO#read is much faster than IO#gets. Your example run in 101sec, 49sec with read(65), and 19sec with read(65000). -- Nobu Nakada