From: Ron Jeffries Date: 2002-03-07T23:58:46+09:00 Subject: Re: file reading impossibly slow? On Thu, 07 Mar 2002 13:52:41 GMT, nobu.nokada@softhome.net wrote: >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). On over 300 megs of file? It takes Windows six minutes to copy it. What are you using for hardware / software? Hmm, I'm so confused. I wonder how hard it would be to get 1.7 running on Windows without Andy's wonderful package ... Thanks, Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.