Is there any way to profile controllers? Or even models - trying the scripts/profiler throws an error: ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/ dependencies.rb:186:in `const_missing'': uninitialized constant Profiler__ (NameError) from script/profiler:30 Does the profiler script work for everyone else and it''s just borked in my installation? The main reason for this is I have a controller that works fine on my development machine, but is insanely slow on the deployment machine. Both are using apache+fastcgi, and most of the other controllers are more or less the same speed....I was hoping to profile just that controller and see if I could narrow it down a bit, but it seems I''m out of luck. Any ideas/hints? Thanks- Andy This e-mail is intended only for the named person or entity to which it is addressed and contains valuable business information that is privileged, confidential and/or otherwise protected from disclosure. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is strictly prohibited. All contents are the copyright property of TBWA Worldwide, its agencies or a client of such agencies. If you are not the intended recipient, you are nevertheless bound to respect the worldwide legal rights of TBWA Worldwide, its agencies and its clients. We require that unintended recipients delete the e-mail and destroy all electronic copies in their system, retaining no copies in any media. If you have received this e-mail in error, please immed iately notify us via e-mail to disclaimer-gmedECeM+8uzBvABCwad6g@public.gmane.org We appreciate your cooperation. We make no warranties as to the accuracy or completeness of this e-mail and accept no liability for its content or use. Any opinions expressed in this e-mail are those of the author and do not necessarily reflect the opinions of TBWA Worldwide or any of its agencies or affiliates.
On 10/4/05, Andy McCown <andy.mccown-gmedECeM+8v2eFz/2MeuCQ@public.gmane.org> wrote:> > Is there any way to profile controllers? Or even models - trying the > scripts/profiler throws an error: > ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/ > dependencies.rb:186:in `const_missing'': uninitialized constant > Profiler__ (NameError) > from script/profiler:30 > > Does the profiler script work for everyone else and it''s just borked > in my installation? > > The main reason for this is I have a controller that works fine on my > development machine, but is insanely slow on the deployment machine. > Both are using apache+fastcgi, and most of the other controllers are > more or less the same speed....I was hoping to profile just that > controller and see if I could narrow it down a bit, but it seems I''m > out of luck.The problem is that it never requires the profiler library, unless you happen to be on ruby 1.9: http://dev.rubyonrails.com/attachment/ticket/1863/profiler_require.diff require ''rubyprof_ext'' Prof.print_profile(results, $stderr) rescue LoadError + require ''profiler'' $stderr.puts ''Using the standard Ruby profiler.'' Profiler__.start_profile profile_me -- rick http://techno-weenie.net
On Oct 4, 2005, at 7:27 PM, Rick Olson wrote:> On 10/4/05, Andy McCown <andy.mccown-gmedECeM+8v2eFz/2MeuCQ@public.gmane.org> wrote: > >> >> Is there any way to profile controllers? Or even models - trying the >> scripts/profiler throws an error: >> ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/ >> dependencies.rb:186:in `const_missing'': uninitialized constant >> Profiler__ (NameError) >> from script/profiler:30 >> >> Does the profiler script work for everyone else and it''s just borked >> in my installation? >> >> The main reason for this is I have a controller that works fine on my >> development machine, but is insanely slow on the deployment machine. >> Both are using apache+fastcgi, and most of the other controllers are >> more or less the same speed....I was hoping to profile just that >> controller and see if I could narrow it down a bit, but it seems I''m >> out of luck. >> > > The problem is that it never requires the profiler library, unless you > happen to be on ruby 1.9: > > http://dev.rubyonrails.com/attachment/ticket/1863/ > profiler_require.diff > > require ''rubyprof_ext'' > Prof.print_profile(results, $stderr) > rescue LoadError > + require ''profiler'' > $stderr.puts ''Using the standard Ruby profiler.'' > Profiler__.start_profile > profile_meThanks Rick, that worked fine, so I can profile models now. Does anyone know a way to profile controllers (or actually, rendering)? Obviously there could be issues with controllers/methods that needed forms, or session info, or things like that, but I have a very simple one that is slowing down in the rendering stage, and being able to profile the render could be a big help. Andy This e-mail is intended only for the named person or entity to which it is addressed and contains valuable business information that is privileged, confidential and/or otherwise protected from disclosure. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is strictly prohibited. All contents are the copyright property of TBWA Worldwide, its agencies or a client of such agencies. If you are not the intended recipient, you are nevertheless bound to respect the worldwide legal rights of TBWA Worldwide, its agencies and its clients. We require that unintended recipients delete the e-mail and destroy all electronic copies in their system, retaining no copies in any media. If you have received this e-mail in error, please immed iately notify us via e-mail to disclaimer-gmedECeM+8uzBvABCwad6g@public.gmane.org We appreciate your cooperation. We make no warranties as to the accuracy or completeness of this e-mail and accept no liability for its content or use. Any opinions expressed in this e-mail are those of the author and do not necessarily reflect the opinions of TBWA Worldwide or any of its agencies or affiliates.