← Index
NYTProf Performance Profile   « line view »
For runner.pl
  Run on Thu Jul 3 15:14:19 2014
Reported on Thu Jul 3 15:16:35 2014

Filename/usr/share/perl5/core_perl/vars.pm
StatementsExecuted 52 statements in 1.72ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
333290µs360µsvars::::importvars::import
243170µs70µsvars::::CORE:matchvars::CORE:match (opcode)
11142µs42µsvars::::BEGIN@3vars::BEGIN@3
11120µs249µsvars::::BEGIN@7vars::BEGIN@7
11118µs52µsvars::::BEGIN@8vars::BEGIN@8
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package vars;
2
32204µs142µs
# spent 42µs within vars::BEGIN@3 which was called: # once (42µs+0s) by constant::BEGIN@6 at line 3
use 5.006;
# spent 42µs making 1 call to vars::BEGIN@3
4
512µsour $VERSION = '1.03';
6
72101µs2478µs
# spent 249µs (20+229) within vars::BEGIN@7 which was called: # once (20µs+229µs) by constant::BEGIN@6 at line 7
use warnings::register;
# spent 249µs making 1 call to vars::BEGIN@7 # spent 229µs making 1 call to warnings::register::import
821.02ms285µs
# spent 52µs (18+34) within vars::BEGIN@8 which was called: # once (18µs+34µs) by constant::BEGIN@6 at line 8
use strict qw(vars subs);
# spent 52µs making 1 call to vars::BEGIN@8 # spent 34µs making 1 call to strict::import
9
10
# spent 360µs (290+70) within vars::import which was called 3 times, avg 120µs/call: # once (129µs+28µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm # once (95µs+25µs) by constant::BEGIN@6 at line 6 of constant.pm # once (65µs+18µs) by Config::BEGIN@11 at line 11 of Config.pm
sub import {
1137µs my $callpack = caller;
12312µs my (undef, @imports) = @_;
1332µs my ($sym, $ch);
14344µs foreach (@imports) {
158142µs849µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 49µs making 8 calls to vars::CORE:match, avg 6µs/call
16843µs812µs if ($sym =~ /\W/) {
# spent 12µs making 8 calls to vars::CORE:match, avg 2µs/call
17 # time for a more-detailed check-up
18 if ($sym =~ /^\w+[[{].*[]}]$/) {
19 require Carp;
20 Carp::croak("Can't declare individual elements of hash or array");
21 } elsif (warnings::enabled() and length($sym) == 1 and $sym !~ tr/a-zA-Z//) {
22 warnings::warn("No need to declare built-in vars");
23 } elsif (($^H &= strict::bits('vars'))) {
24 require Carp;
25 Carp::croak("'$_' is not a valid variable name under strict vars");
26 }
27 }
28846µs89µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 9µs making 8 calls to vars::CORE:match, avg 1µs/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35888µs : do {
36 require Carp;
37 Carp::croak("'$_' is not a valid variable name");
38 });
39 } else {
40 require Carp;
41 Carp::croak("'$_' is not a valid variable name");
42 }
43 }
44};
45
4619µs1;
47__END__
 
# spent 70µs within vars::CORE:match which was called 24 times, avg 3µs/call: # 8 times (49µs+0s) by vars::import at line 15, avg 6µs/call # 8 times (12µs+0s) by vars::import at line 16, avg 2µs/call # 8 times (9µs+0s) by vars::import at line 28, avg 1µs/call
sub vars::CORE:match; # opcode