9

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

chrsblck
  • 3,948
  • 2
  • 17
  • 20
runtimeZero
  • 26,466
  • 27
  • 73
  • 126

1 Answers1

7
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.

mob
  • 117,087
  • 18
  • 149
  • 283