Filename | /usr/share/perl/5.18/if.pm |
Statements | Executed 46 statements in 554µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4 | 1 | 1 | 959µs | 1.00ms | work | if::
4 | 4 | 3 | 12µs | 12µs | import | if::
4 | 1 | 1 | 7µs | 7µs | CORE:subst (opcode) | if::
0 | 0 | 0 | 0s | 0s | unimport | if::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package if; | ||||
2 | |||||
3 | 1 | 400ns | $VERSION = '0.0602'; | ||
4 | |||||
5 | # spent 1.00ms (959µs+44µs) within if::work which was called 4 times, avg 251µs/call:
# 4 times (959µs+44µs) by Devel::InnerPackage::BEGIN@7 or Module::Pluggable::Object::BEGIN@11 or Moose::Object::BEGIN@15 or Moose::Object::BEGIN@16 at line 18, avg 251µs/call | ||||
6 | 4 | 2µs | my $method = shift() ? 'import' : 'unimport'; | ||
7 | 4 | 1µs | die "Too few arguments to 'use if' (some code returning an empty list in list context?)" | ||
8 | unless @_ >= 2; | ||||
9 | 4 | 700ns | return unless shift; # CONDITION | ||
10 | |||||
11 | 4 | 1µs | my $p = $_[0]; # PACKAGE | ||
12 | 4 | 16µs | 4 | 7µs | (my $file = "$p.pm") =~ s!::!/!g; # spent 7µs making 4 calls to if::CORE:subst, avg 2µs/call |
13 | 4 | 453µs | require $file; # Works even if $_[0] is a keyword (like open) | ||
14 | 4 | 34µs | 4 | 7µs | my $m = $p->can($method); # spent 7µs making 4 calls to UNIVERSAL::can, avg 2µs/call |
15 | 4 | 15µs | 3 | 1.89ms | goto &$m if $m; # spent 1.74ms making 1 call to metaclass::import
# spent 145µs making 2 calls to deprecate::import, avg 73µs/call |
16 | } | ||||
17 | |||||
18 | 12 | 28µs | 4 | 1.00ms | # spent 12µs within if::import which was called 4 times, avg 3µs/call:
# once (5µs+0s) by Moose::Object::BEGIN@15 at line 15 of Moose/Object.pm
# once (4µs+0s) by Devel::InnerPackage::BEGIN@7 at line 7 of Devel/InnerPackage.pm
# once (2µs+0s) by Module::Pluggable::Object::BEGIN@11 at line 11 of Module/Pluggable/Object.pm
# once (2µs+0s) by Moose::Object::BEGIN@16 at line 16 of Moose/Object.pm # spent 1.00ms making 4 calls to if::work, avg 251µs/call |
19 | sub unimport { shift; unshift @_, 0; goto &work } | ||||
20 | |||||
21 | 1 | 2µs | 1; | ||
22 | __END__ | ||||
# spent 7µs within if::CORE:subst which was called 4 times, avg 2µs/call:
# 4 times (7µs+0s) by if::work at line 12, avg 2µs/call |