← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:11 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/5.18.2/if.pm
StatementsExecuted 41 statements in 137µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
411370µs410µsif::::workif::work
44412µs12µsif::::importif::import
3112µs2µsif::::CORE:substif::CORE:subst (opcode)
0000s0sif::::unimportif::unimport
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package if;
2
31500ns$VERSION = '0.0602';
4
5
# spent 410µs (370+40) within if::work which was called 4 times, avg 102µs/call: # 4 times (370µs+40µs) by Devel::InnerPackage::BEGIN@7 or Module::Pluggable::BEGIN@7 or Module::Pluggable::Object::BEGIN@11 or flock::BEGIN@109 at line 18, avg 102µs/call
sub work {
642µs my $method = shift() ? 'import' : 'unimport';
742µs die "Too few arguments to 'use if' (some code returning an empty list in list context?)"
8 unless @_ >= 2;
944µs return unless shift; # CONDITION
10
113600ns my $p = $_[0]; # PACKAGE
12311µs32µs (my $file = "$p.pm") =~ s!::!/!g;
# spent 2µs making 3 calls to if::CORE:subst, avg 667ns/call
13357µs require $file; # Works even if $_[0] is a keyword (like open)
14317µs34µs my $m = $p->can($method);
# spent 4µs making 3 calls to UNIVERSAL::can, avg 1µs/call
15314µs3261µs goto &$m if $m;
# spent 261µs making 3 calls to deprecate::import, avg 87µs/call
16}
17
181227µs4410µs
# spent 12µs within if::import which was called 4 times, avg 3µs/call: # once (4µs+0s) by flock::BEGIN@109 at line 109 of Path/Tiny.pm # once (3µs+0s) by Devel::InnerPackage::BEGIN@7 at line 7 of Devel/InnerPackage.pm # once (3µs+0s) by Module::Pluggable::BEGIN@7 at line 7 of Module/Pluggable.pm # once (2µs+0s) by Module::Pluggable::Object::BEGIN@11 at line 11 of Module/Pluggable/Object.pm
sub import { shift; unshift @_, 1; goto &work }
# spent 410µs making 4 calls to if::work, avg 102µs/call
19sub unimport { shift; unshift @_, 0; goto &work }
20
2112µs1;
22__END__
 
# spent 2µs within if::CORE:subst which was called 3 times, avg 667ns/call: # 3 times (2µs+0s) by if::work at line 12, avg 667ns/call
sub if::CORE:subst; # opcode