Profile Perl

I was trying to profile a Perl program which runs much longer than what I expected. I did a search on “profile perl”. It turns out it’s pretty easy to do. Here are steps,

1. Run perl program with -d:DProf. The profiling data will be saved to tmon.out.

perl -d:DProf test.perl

2. Run this command to print the time and number of calls for each function.

dprofpp -I tmon.out

References
A full article on this topic.
Perl FAQ on this topic.

2 Responses to “Profile Perl”

  1. [...] a better perl profiler Back in August, I was profiling a perl script using Devel::DProf. As Tim Bunce suggested to me at that time, Devel::DProf was old and has some [...]

Leave a Reply