ashisht has asked for the wisdom of the Perl Monks concerning the following question:

Dear Perl Monks,

I would appreciate your help yet again. I am trying to profile my Perl code. It is a little slow and I want to determine where it is spending most of its time. Is there a module I could use to perform the profiling?

Thanks,
Ashish.

Replies are listed 'Best First'.
Re: Profiling Perl Code
by adrianh (Chancellor) on Mar 23, 2004 at 20:00 UTC
    Is there a module I could use to perform the profiling?

    Yup. Take a look at Devel::SmallProf.

Re: Profiling Perl Code
by amw1 (Friar) on Mar 23, 2004 at 21:22 UTC
    on the timtowtdi front there is also Devel::DProf. To profile test.pl
    perl -d:DProf test.pl
    this will create a tmon.out file which can be read by dprofpp. I've used this with some success. I have not used the other module referenced and will give it a shot when I get the need.
Re: Profiling Perl Code
by Vautrin (Hermit) on Mar 23, 2004 at 21:26 UTC
    Nobody's mentioned Benchmark.pm yet. Also, search for the word Benchmark on CPAN. A quick search turned up many, many modules.

    Want to support the EFF and FSF by buying cool stuff? Click here.