I have a Perl script that takes about 30 minutes to run, so of course I run Devel::NYTProf. Great profiler. For many of my subs, I'm getting some data that doesn't make sense to me.
I'm running with perl 5.10.0 on Linux using the default NYTProf settings.
In the HTML output, each of the subs has a summary section stating how much time is spent in the sub and its children and then goes on to give me line information.
The line statistics don't add up to the total spent in the function. What gives?
For example, I have a function that's reported to use 233s (57+166). The line-by-line number report has one line that uses 20s, another that uses 4 and one that uses 2. The other lines are <1s and the function is not that long.
What can I do to resolve this mismatch?
I could move to Perl 5.12 but that would take some work to install the dependencies. I'm happy to run it in a slower mode. Is there a way to increase the sampling frequency? Run on a slower machine?
Click here for a sample: my NYTProf output. In this case, the sub is reported to use 225 seconds, but adding all of the numbers yields 56 seconds. This run had optimization turned off:
setenv NYTPROF optimize=0:file=nytprof.optout
Update I've rerun with Perl 5.12 using the findcaller=1 option flag as suggested with more or less the same results. (I ran on a different dataset)