From: "M. Edward (Ed) Borasky" Date: 2006-08-18T23:06:00+09:00 Subject: Re: Ruby, memory and speed Bill Kelly wrote: > From: "Francis Cianfrocca" >> >> This is a perfect example of what I've noticed many times: Ruby's >> performance is perfectly fast and acceptable until the working set gets a >> certain (not terribly large) size, then it falls off a cliff. GC >> perhaps has >> something to do with it, but I suspect that's only a small part of the >> problem. > > Can anyone speculate as to what other subsystems or facets of Ruby's > architecture, besides GC, might possibly cause this? > > > Regards, > > Bill > > > > I've posted a script for building a "gprof-enabled" Ruby on GNU/Linux systems at http://rubyforge.org/cgi-bin/viewvc.cgi/MatrixBenchmark/?root=cougar It's a pretty simple process to dig into at least the CPU portion of the equation -- where is the Ruby interpreter spending cycles interpreting your script? Some more sophisticated tools are required to profile memory usage, but it's more or less impossible for a normally-designed program to abuse memory without spending CPU cycles doing it. :) Another simple thing you can do is run "top" while your Ruby script is executing. On Windows, the Task Manager will do the same thing in the "Process" tab. Sort in descending order on CPU and if your script is at the "top", it's spending CPU time. Sort in descending order on memory size and if your script is at the top without a lot of CPU usage, it's a memory management bottleneck.