Profile of if.pm

← Index
NYTProf Performance Profile «block view•line view•sub view»
For xt/tapper-mcp-scheduler-with-db-longrun.t
Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:35 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/5.12.3/if.pm
Statements | Executed 24 statements in 69µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
2 | 1 | 1 | 40µs | 50µs | if::::workif::work
2 | 2 | 1 | 6µs | 6µs | if::::importif::import
2 | 1 | 1 | 5µs | 5µs | if::::CORE:substif::CORE:subst (opcode)
0 | 0 | 0 | 0s | 0s | if::::unimportif::unimport

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package if;
2 |  |  |  |  |
3 | 1 | 400ns |  |  | $VERSION = '0.05';
4 |  |  |  |  |
5 |  |  |  |  | # spent 50µs (40+10) within if::work which was called 2 times, avg 25µs/call: # 2 times (40µs+10µs) by Moose::Object::BEGIN@19 or Moose::Object::BEGIN@20 at line 18, avg 25µs/call sub work {
6 | 16 | 54µs |  |  | my $method = shift() ? 'import' : 'unimport';
7 |  |  |  |  | die "Too few arguments to `use if' (some code returning an empty list in list context?)"
8 |  |  |  |  | unless @_ >= 2;
9 |  |  |  |  | return unless shift; # CONDITION
10 |  |  |  |  |
11 |  |  |  |  | my $p = $_[0]; # PACKAGE
12 |  |  | 2 | 5µs | (my $file = "$p.pm") =~ s!::!/!g; # spent 5µs making 2 calls to if::CORE:subst, avg 3µs/call
13 |  |  |  |  | require $file; # Works even if $_[0] is a keyword (like open)
14 |  |  | 2 | 4µs | my $m = $p->can($method); # spent 4µs making 2 calls to UNIVERSAL::can, avg 2µs/call
15 |  |  | 1 | 2.43ms | goto &$m if $m; # spent 2.43ms making 1 call to metaclass::import
16 |  |  |  |  | }
17 |  |  |  |  |
18 | 6 | 12µs | 2 | 50µs | # spent 6µs within if::import which was called 2 times, avg 3µs/call: # once (4µs+0s) by Moose::Object::BEGIN@19 at line 19 of Moose/Object.pm # once (2µs+0s) by Moose::Object::BEGIN@20 at line 20 of Moose/Object.pm sub import { shift; unshift @_, 1; goto &work } # spent 50µs making 2 calls to if::work, avg 25µs/call
19 |  |  |  |  | sub unimport { shift; unshift @_, 0; goto &work }
20 |  |  |  |  |
21 | 1 | 2µs |  |  | 1;
22 |  |  |  |  | __END__
|  |  |  |  | # spent 5µs within if::CORE:subst which was called 2 times, avg 3µs/call: # 2 times (5µs+0s) by if::work at line 12, avg 3µs/call sub if::CORE:subst; # opcode