Good screencast. I'd like to see more information on how you can optimize things once you narrow down the culprits. Maybe a checklist of 'gotchas' or something like that. Especially any that are common and not well known.
Great screencast! Thank you very much for all this great information.
Thanks
Eddie Moses
Little typo detected
should be:
sudo gem install ruby-prof
Great podcast, thanks for the info
@Sam:
its ruby-perf only. (perf => performance)
Nice screencast. I really need to measure performance issues of my app and tutorials like this are of great help. :)
@Carl, I did some previous episodes on optimization, but they don't cover everything so you can expect some more in the future. You can find them out here.
http://railscasts.com/tags/1
@Sam, thanks. Fixed.
Hey Ryan, Passenger (mod_rails) is looking for someone to redo there screencast before they release. I think you would be the perfect person for it.
check it out here...
http://izumi.plan99.net/blog/
@Taylor, thanks for the link. I'll look into doing it. :)
I'm able to run a script, but the files don't contain useful numbers. On Ubuntu (32bit), the first column of profile-flat contains a mix of inf and nan. I'll dig into this, but if you have some guidance, it would be greatly appreciated.
I've tried it on 32-bit Vista, 64-bit Ubuntu & 32-bit Ubuntu. They all report some sort of error. On 64-bit Ubuntu, it aborts with an Integer range error. On Vista, it complains that the files (txt & html) don't exist (though I can open them and see listings for all the methods with no timings). On 32bit Ubuntu, it complains twice about "Could not get a file descriptor referring to the console." These last two create files though the content lacks timings.
In the case of the discipline of pure reason, our a posteriori knowledge, then, teaches us nothing whatsoever regarding the content of the objects in space and time, as is evident upon close examination.
How do you get ruby-prof installed under osx? I've tried under both Tiger and Leopard and I get
No definition for prof_get_cpu_frequency
No definition for prof_set_cpu_frequency
on both
I get the same message No definition for prof_get_cpu_frequency both under OS X (Leopard) & Linux (CentOS 5).
When I run the request script I get following:
Warming up once
0.03 sec, 1 requests, 29 req/sec
Profiling 100x
`gem install ruby-prof` to use the profiler
Only thing i found is this:
Please use Jeremy Kamper's ruby-prof :http://github.com/jeremy/ruby-prof/tree/master
gem sources -a http://gems.github.com
sudo gem install jeremy-ruby-prof
but does not work for me either...
I had the same problem as everyone above and also failed to get it working with jeremy's gem. I did however get it to work after some investigation.
I took a look at the rails source and it requires ruby-prof 0.6.1. After installing Jeremy's gem I realized it had a slightly different name (jeremy-ruby-prof vs. ruby-prof.) That's probably a github thing but it wasn't satisfying the gem command inside of rails.
So I built the gem from ruby forge source (rake gem, and install manually from the pkg location) and it worked!
For integration testing you can define session[:user] by adding a second hash, for the session.
get "users/1/edit", {}, {:user_id => 1}
... but this doesn't seem to work for profiling, for some reason.





