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.
Advertisements
Devel::DProf is badly broken.
I strongly suggest you read http://blog.timbunce.org/2008/07/12/devel-dprof-broken-by-the-passage-of-time/
Then http://blog.timbunce.org/2008/07/15/nytprof-v2-a-major-advance-in-perl-profilers/
Or sit back and watch http://blip.tv/file/1130150/
[…] 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 […]
About Kumarakom…
[…]Profile Perl « Hao’s Blog[…]…