|go ahead... be a heretic|
Devel::Dprof is your friendby Ovid (Cardinal)
|on Aug 03, 2001 at 00:45 UTC||Need Help??|
We're currently working on an application that is having some performance issues. Some of these issues are significant enough that they're killing the application and simply analyzing the error, access, and event logs has let us know where to turn. Now that we've gotten many of the serious issues out of the way, we still need to improve its performance, but since the application is no longer crashing, no one knew where to look in the logs.
Meetings were getting ugly. Everyone would have some sort of theory as to what was slowing things down.
"It's foo that's killing performance."
"No, it's bar I tell you.
I decided to avoid the arguments and simply start gathering evidence for whatever was going on. I did a little research and discovered Devel::Dprof. I ran it against a program that analyzes Web pages and here's the output I (after running it through dprofpp and asking for the running time of the 15 longest running subs).
After reviewing results, playing with the code, and rerunning Devel::Dprof several times, I discovered chunks of old debugging code and plenty of code that could be subtly tweaked for a performance boost. In less than a quarter hour I had the following:
This wasn't any of our production code (that's next), but according to elapsed User Time, performance was boosted over 30% -- I ran the before and after results several times to verify the gains. Interestingly, this was code that I had written. I knew it well and I knew that there was little, if anything, that I could optimize.
Boy, was I wrong.
Check out Devel::Dprof next time you have performance issues. It's well worth learning.
Vote for paco!
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.