← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:50 2015

Filename/usr/share/perl/5.20/if.pm
StatementsExecuted 35 statements in 746µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3111.09ms1.14msif::::workif::work
33311µs11µsif::::importif::import
3114µs4µ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.0603';
4
5
# spent 1.14ms (1.09+52µs) within if::work which was called 3 times, avg 381µs/call: # 3 times (1.09ms+52µs) by CGI::BEGIN@3 or CGI::Cookie::BEGIN@6 or CGI::Util::BEGIN@5 at line 18, avg 381µs/call
sub work {
632µs my $method = shift() ? 'import' : 'unimport';
732µs die "Too few arguments to 'use if' (some code returning an empty list in list context?)"
8 unless @_ >= 2;
93800ns return unless shift; # CONDITION
10
1131µs my $p = $_[0]; # PACKAGE
12316µs34µs (my $file = "$p.pm") =~ s!::!/!g;
# spent 4µs making 3 calls to if::CORE:subst, avg 2µs/call
133658µs require $file; # Works even if $_[0] is a keyword (like open)
14326µs37µs my $m = $p->can($method);
# spent 7µs making 3 calls to UNIVERSAL::can, avg 2µs/call
15316µs3236µs goto &$m if $m;
# spent 236µs making 3 calls to deprecate::import, avg 79µs/call
16}
17
18922µs31.14ms
# spent 11µs within if::import which was called 3 times, avg 4µs/call: # once (4µs+0s) by CGI::Util::BEGIN@5 at line 5 of CGI/Util.pm # once (4µs+0s) by CGI::Cookie::BEGIN@6 at line 6 of CGI/Cookie.pm # once (3µs+0s) by CGI::BEGIN@3 at line 3 of CGI.pm
sub import { shift; unshift @_, 1; goto &work }
# spent 1.14ms making 3 calls to if::work, avg 381µs/call
19sub unimport { shift; unshift @_, 0; goto &work }
20
2112µs1;
22__END__
 
# spent 4µs within if::CORE:subst which was called 3 times, avg 2µs/call: # 3 times (4µs+0s) by if::work at line 12, avg 2µs/call
sub if::CORE:subst; # opcode