← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:07 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/if.pm
StatementsExecuted 24 statements in 39µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
21121µs26µsif::::workif::work
2213µs3µsif::::importif::import
2112µ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
31300ns$VERSION = '0.0604';
4
5
# spent 26µs (21+4) within if::work which was called 2 times, avg 13µs/call: # 2 times (21µs+4µs) by Moose::Object::BEGIN@15 or Moose::Object::BEGIN@16 at line 18, avg 13µs/call
sub work {
62700ns my $method = shift() ? 'import' : 'unimport';
72600ns die "Too few arguments to 'use if' (some code returning an empty list in list context?)"
8 unless @_ >= 2;
92200ns return unless shift; # CONDITION
10
112300ns my $p = $_[0]; # PACKAGE
1226µs22µs (my $file = "$p.pm") =~ s!::!/!g;
# spent 2µs making 2 calls to if::CORE:subst, avg 850ns/call
1323µs require $file; # Works even if $_[0] is a keyword (like open)
14213µs23µs my $m = $p->can($method);
# spent 3µs making 2 calls to UNIVERSAL::can, avg 1µs/call
1525µs16.06ms goto &$m if $m;
# spent 6.06ms making 1 call to metaclass::import
16}
17
1868µs226µs
# spent 3µs within if::import which was called 2 times, avg 2µs/call: # once (2µs+0s) by Moose::Object::BEGIN@15 at line 15 of Moose/Object.pm # once (1µs+0s) by Moose::Object::BEGIN@16 at line 16 of Moose/Object.pm
sub import { shift; unshift @_, 1; goto &work }
# spent 26µs making 2 calls to if::work, avg 13µs/call
19sub unimport { shift; unshift @_, 0; goto &work }
20
2112µs1;
22__END__
 
# spent 2µs within if::CORE:subst which was called 2 times, avg 850ns/call: # 2 times (2µs+0s) by if::work at line 12, avg 850ns/call
sub if::CORE:subst; # opcode