in reply to Finding bottlenecks in the code

I've had less problems using Devel::SmallProf than many others. Be warned, it profiles line by line and so *really* slows down the runtime of your code, but the results seem pretty accurate.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Replies are listed 'Best First'.
Re^2: Finding bottlenecks in the code
by punkish (Priest) on Jun 12, 2005 at 16:36 UTC
    Yes, better luck with Devel::SmallProf, however, as you say, it is line-by-line profiling.

    Most of the profiling seems to be going on in the packages that are not in my control (HTML::Template, DBI, etc.). So, I am still in unhappy-town. I am going with the assumption that it is my code that is wrong, and solving that is a task as it is. Trying to figure out what is going on in something like H::T or DBI or CGI::Simple is way beyond me.

    --

    when small people start casting long shadows, it is time to go to bed

      Being selective in what you profile may help. From the Devel::SmallProf POD

      %DB::packages

      To only profile code in a certain package, set the %DB::packages array. For example, to see only the code in packages main and Test1, do this:

      %DB::packages = ( 'main' => 1, 'Test1' => 1 );

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.