NYTProf Profiler for Perl
Asked Answered
A

1

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

Aegyptus answered 19/4, 2013 at 21:13 Comment(0)
N
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.

Newell answered 19/4, 2013 at 21:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.