in reply to Finding bottlenecks in the code

Devel::Cover can make you a nicely formatted output that shows the relative expense of every line. For example, it might show that a certain $sth->execute($sql) takes a ton of time, which is my first 'usual suspect' -- the db calls. are you _sure_ there's no slow queries (everything has, and is using, an index, etc)?

Is there any code (or even sql) you can provide? Maybe just a small segment that is known or suspected to be slow?

Replies are listed 'Best First'.
Re^2: Finding bottlenecks in the code
by punkish (Priest) on Jun 12, 2005 at 16:27 UTC
    Well, I installed Devel::Cover and got, really nothing.
    perl -MDevel::Cover index.cgi Devel::Cover 0.53: Collecting coverage data for branch, condition, pod +, statement, subroutine and time. Selecting packages matching: Ignoring packages matching: /Devel/Cover[./] Ignoring packages in: . /Library/Perl /Library/Perl/5.8.1 /Library/Perl/5.8.1/darwin-thread-multi-2level /System/Library/Perl/5.8.1 /System/Library/Perl/5.8.1/darwin-thread-multi-2level .. bunch of output from my index.cgi .. bus error

    Then, an empty coverage.html

    --

    when small people start casting long shadows, it is time to go to bed
      You have to explicitly tell Devel::Cover what files to cover. See the docs for specifics, but something along the lines of (note it sets the output to go into /tmp/covertest/):
      /usr/bin/perl -MDevel::Cover=-db,/tmp/covertest,-silent,0,-ignore,.,-s +elect,/home/you/your_pm index.cgi