← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:14 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/5.18.0/if.pm
StatementsExecuted 24 statements in 48µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
21125µs31µsif::::workif::work
2214µs4µsif::::importif::import
2113µs3µ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
31400ns$VERSION = '0.0602';
4
5
# spent 31µs (25+6) within if::work which was called 2 times, avg 15µs/call: # 2 times (25µs+6µs) by Moose::Object::BEGIN@19 or Moose::Object::BEGIN@20 at line 18, avg 15µs/call
sub work {
62700ns my $method = shift() ? 'import' : 'unimport';
72500ns die "Too few arguments to 'use if' (some code returning an empty list in list context?)"
8 unless @_ >= 2;
92100ns return unless shift; # CONDITION
10
112400ns my $p = $_[0]; # PACKAGE
1228µs23µs (my $file = "$p.pm") =~ s!::!/!g;
# spent 3µs making 2 calls to if::CORE:subst, avg 2µs/call
132500ns require $file; # Works even if $_[0] is a keyword (like open)
14216µs23µs my $m = $p->can($method);
# spent 3µs making 2 calls to UNIVERSAL::can, avg 1µs/call
1528µs11.63ms goto &$m if $m;
# spent 1.63ms making 1 call to metaclass::import
16}
17
18610µs231µs
# spent 4µs within if::import which was called 2 times, avg 2µs/call: # once (2µ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 31µs making 2 calls to if::work, avg 15µs/call
19sub unimport { shift; unshift @_, 0; goto &work }
20
2113µs1;
22__END__
 
# spent 3µs within if::CORE:subst which was called 2 times, avg 2µs/call: # 2 times (3µs+0s) by if::work at line 12, avg 2µs/call
sub if::CORE:subst; # opcode