I'm not an expert on Ruby optimization, but have you looked at
perftools.rb? It says that it's a sampling profiler with minimal
overhead.

https://github.com/tmm1/perftools.rb

Andrew

On Tue, Oct 11, 2011 at 3:29 AM, Roger Pack <rogerdpack2 / gmail.com> wrote:
>> Would it be plausible to somehow, get the (ruby) stack of the running ruby process (or a particular thread), periodically?  ¨Βος εψανπμε¬ εφες±°εγοξδσ>>
>> One approach might be to have a separate thread with a timer that poppednd it would get the current stack for a particular thread (not itself).
>>
>> The overall objective is to have a very light weight (low impact) technique for profiling a Rails app as it is running in production.  ¨Βφετθγουςσε οζ χεελζοεψανπμε¬ ηατθες εξουηθ στατιστιγσ το υξδεςσταξδ χθεςτθαπισ σπεξδιξη τθνοστ τινε>>
>> Of course, the other question is: has this already been done? I couldn't find anything.)
>
> I don't think it has. .9.x provides you a Thread#backtrace so it
> should be possible just using that.  ¨Β§φβεεξ νεαξιξτο ιξγοςποςατ> it into the
> ruby-prof gem, and will put it on the backlog...
> https://github.com/danielhoey/ruby-prof might already do it.
> -r
>
>