It makes me want to cry that people are still writing things in technologies that require you to drop little timing statements into your code to profile them.
Profilers have been around for what? 30 years? I think the first time I hooked Ants Profiler up to an ASP.NET site was 2002. Are these other web technologies really that far behind the state of the art?
I didn't feel like getting into the nitty-gritty details of my analysis, but Ruby does have a profiler, and it integrates into Rails quite well, and I was using it together with timers in this investigation. However, the exact same issue applies to the profiler as to simple timers, which is that the 150ms in question happens _after_ Rails hands off the reply to the web server, so as long as you are only measuring within the Rails framework, you will not see it.
Strange. My expectation would be that you'd hook a profiler up to the web process and it would simply follow all ruby code paths, regardless of whether Rails were involved or not. Or do we have different definitions of Profiler?
You're talking about a separate application that watches executing code and keeps statistics, right? As in, not simply a set of timing functions in a wrapper somewhere in the framework? If so, how does it come off the trolley after Rails finishes its job?
ruby-prof is a module that runs inside the ruby process, and hooks into the interpreter to track what's happening. You have options for how to run it. You can run the entire program within the profiler, but if you do that, you won't get data out until the process ends (you kill the webserver, in this case). Or, you can do what's more typical for profiling Rails, which is to explicitly activate the profiler for the course of a single request, and report on that single request.
Take these kind of comments to Reddit, you obviously know nothing about Rails and Ruby, especially Rack and Metal.
"Metal components operate outside the realm of the usual Rails timing and logging components, so you don’t get any internal measurements of page performance."
Indeed, I'd never heard of Metal before reading this post. The quote you included is what lead me to wonder why there are not better tools for such a popular development framework as Ruby on Rails.
As that quote states, there doesn't appear to be a profiler as such, but rather a set of "timing and logging components" built into the framework. If it's true, then ruby today is essentially handling profiling the same way PHP did it in 1998. I find that surprising and saddening.
Also, what is the way PHP handles profiling in 2009 ? I haven't developed in php in quite a while, and I admit I never used anything more complicated then the profiling tools built in Zend Studio.
Profilers have been around for what? 30 years? I think the first time I hooked Ants Profiler up to an ASP.NET site was 2002. Are these other web technologies really that far behind the state of the art?