in reply to Re: Add a code to first and last line of all the subroutines in a perl package
in thread Add a code to first and last line of all the subroutines in a perl package

Thanks.

Actually, a non perl tester is going to profile the code. I want them to do profiling in a painless way. The application is very big and Apache::SmallProf makes the application very slow.

My idea is to add timestamp to begining and end of all subroutines for few packages.

  • Comment on Re^2: Add a code to first and last line of all the subroutines in a perl package

Replies are listed 'Best First'.
Re^3: Add a code to first and last line of all the subroutines in a perl package
by salva (Canon) on Oct 23, 2007 at 08:18 UTC
    Read the documentation for Devel::SmallProf (Apache::SmallProf is a fork of it).

    These profilers can be configured to only profile certain packages. For instance, create a configuration file named .smallprof in your working directory like:

    %DB::packages = qw(Foo Bar);
    and only packages Foo and Bar will be profiled. But don't expect it to be much faster. Non-profiled code will still execute much slower (x2 - x5) than without the profiler.

    Probably you can also use $^P to explicitly activate/deactivate profiling (see perlvar and perldebguts).

    Finally, I would be very glad to collaborate with anyone trying to make Devel::FastProf work with apache (I'm its author!).