Topic: Performance Profiling Tests/Specs
Can anyone recommend a solution for profiling exactly where rspecs are spending their time?
I have one project that runs 1200 specs ( a mix of model, view, and controller specs) in 240 seconds, roughly 0.2s/spec on average.
I have another project that runs 200 specs in 3 seconds ... an average of 0.015s/spec, over an order of magnitude faster per spec.
The trouble is, the style of code and of tests is broadly similar, so I'm not sure why one project's specs are so much slower than the other. I'd like to see some detailed profiling so I could see just where the code is spending its time -- I don't even know if its database time, array.each time, or what. It's easy to get some useful info on this for the app itself with NewRelic RPM development mode, but getting similarly useful stats for the specs is more challenging.
The extreme time the tests take in the big projects makes me wonder if I'm doing something stupid with fixtures or the like that's causing problems.
Thanks for any thoughts!
Last edited by IdahoEv (2010-03-26 20:34:23)