# Effective profiling

**URL:** <https://www.ruby-forum.com/t/effective-profiling/92411>\
**Category:** Ruby\
**Created:** [April 19, 2007, 9:03am UTC](https://www.ruby-forum.com/t/effective-profiling/92411 "2007-04-19T09:03:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [April 19, 2007, 9:03am UTC](https://www.ruby-forum.com/t/effective-profiling/92411/1 "2007-04-19T09:03:54Z")

</div>

I have a friend who’s run into some profiling problems. He set up a  
profiler on a Rails app, maybe the default benchmarking stuff Rails  
comes with, I’m not sure. Unit tests run 60s normally, and come in at  
an hour and a half with the profiler going.

That sounds pretty extreme to me. What’s the best way to profile a big  
app in Ruby? They’ve got a lot of recursive cloning going on, I think  
that’s probably the issue, but how do they find out for sure?

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [April 19, 2007, 9:25am UTC](https://www.ruby-forum.com/t/effective-profiling/92411/2 "2007-04-19T09:25:04Z")

</div>

Giles B. wrote:

> I have a friend who’s run into some profiling problems. He set up a  
> profiler on a Rails app, maybe the default benchmarking stuff Rails  
> comes with, I’m not sure. Unit tests run 60s normally, and come in at  
> an hour and a half with the profiler going.  
> Is that with profile (rather slow) or ruby-prof (should be much faster)?

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [April 19, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/effective-profiling/92411/3 "2007-04-19T16:38:06Z")

</div>

Giles B. wrote:

> I have a friend who’s run into some profiling problems. He set up a  
> profiler on a Rails app, maybe the default benchmarking stuff Rails  
> comes with, I’m not sure. Unit tests run 60s normally, and come in at  
> an hour and a half with the profiler going.
> 
> That sounds pretty extreme to me. What’s the best way to profile a big  
> app in Ruby? They’ve got a lot of recursive cloning going on, I think  
> that’s probably the issue, but how do they find out for sure?

Perhaps premature optimization isn’t so bad after all. 🙂 Seriously,  
though, profiling is a form of testing, and if you’re going to do  
test-driven development but _not_ performance testing, you’re finding  
only _some_ of the bugs. So the best way to profile a big application,  
assuming a total absence of software performance engineering during its  
construction, would be to break it up into smaller pieces in top-down  
fashion.

–  
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)  
[http://borasky-research.net/](http://borasky-research.net/)

If God had meant for carrots to be eaten cooked, He would have given  
rabbits fire.
