From: Jim Freeze Date: 2003-04-11T18:40:13+09:00 Subject: Re: Need IO Optimization help On Friday, 11 April 2003 at 17:32:17 +0900, Brian Candler wrote: > On Fri, Apr 11, 2003 at 03:10:27AM +0900, Jim Freeze wrote: > > Below are the results I get from your benchmarks. I added > > the last test which seems to be the fastest, AND is what > > I was doing in my tests. To bad perl is 50% faster. > > > > Can this be spead up with a C routine? > > I did some profiling of a very similar program, results posted at > http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb?key=-pg&cginame=namazu.rb&submit=Search&dbname=ruby-talk&max=50&whence=0 > > Conclusion: I can see no obvious bottlenecks. When you drill down and work > out how much time is spent in object creation and garbage collection, file > reading and scanning etc. it seems all pretty well balanced to me. The > reading and breaking-into-individual-lines accounts for 1.09 seconds out of > 2.53 seconds > I did some profiles as well and came to the similar conclusions for these simple tests. I'm not sure that if I dropped to rb_io_readline (or whatever), that it would go any faster. However, I plan to repeat the tests with 'code' inside the loop to see if Ruby catches up with Perl when actual work is being done. -- Jim Freeze ---------- Never put off till tomorrow what you can avoid all together.