From: Matt Armstrong Date: 2002-03-19T06:48:43+09:00 Subject: Re: Why is Ruby so slow? Venherm.Borchers@t-online.de (Venherm Borchers) writes: > WHY IS RUBY SO SLOW? We probably can't tell just be reading your code. You may have identified an area where Ruby can be improved, or where the speed under Windows isn't good. To rule out the IO slowness mentioned earlier, you could write a simple program like this: save = [] while line = datafile.gets save << line end And time that on your data files. That'll tell you how much time it takes Ruby to read in the file and store it in an array. The rest of the overhead will likely be in your string manipulation code. Also, ruby has a built in profiler. Run your program like "ruby -r profile your_program.rb" Make sure to use a much smaller data set, since it will really slow your program down. But I find that I like RBProf much better: http://aspectr.sourceforge.net/rbprof/ It is a little quirky, but it gives you more information and doesn't profile every built in function so the program doesn't run anywhere near as slowly. -- matt