Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NYTProf Profiler for Perl

This question is about Devel::NYTProf profiler.

The output that I receive from the profiler for a simple line such as:

use strict;

OUTPUT:

statements: 3 
Time on Line: 22µs
Calls: 2
Time in Sub: 12µs

So my questions are:

  1. How is this 3 statements ?
  2. The time in sub .. what does this represent ?
  3. Does this represent the time spent converting this module into optree or is this something else?
  4. Is this compile phase time or run phase time ?

Thank you in advance

like image 725
runtimeZero Avatar asked Apr 19 '13 21:04

runtimeZero


1 Answers

use Foo;

is equivalent to executing

require Foo;
Foo->import;

at compile time. So perhaps the sub that was called is strict::import.

Update: profiling the program

require strict;
strict->import;

shows that Devel::NYTProf counts the require statement as one sub call and import as another.

like image 128
mob Avatar answered Oct 26 '22 01:10

mob