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