← Index
NYTProf Performance Profile   « line view »
For -e
  Run on Thu Jun 30 16:34:56 2016
Reported on Thu Jun 30 16:35:08 2016

Filename/home/s1/perl5/perlbrew/perls/perl-5.22.1/lib/5.22.1/vars.pm
StatementsExecuted 172 statements in 871µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
101010347µs441µsvars::::importvars::import
933194µs94µsvars::::CORE:matchvars::CORE:match (opcode)
11119µs19µsvars::::BEGIN@3vars::BEGIN@3
1117µs82µsvars::::BEGIN@7vars::BEGIN@7
1117µs19µ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
3265µs119µs
# spent 19µs within vars::BEGIN@3 which was called: # once (19µs+0s) by version::BEGIN@11 at line 3
use 5.006;
# spent 19µs making 1 call to vars::BEGIN@3
4
51500nsour $VERSION = '1.03';
6
7231µs2156µs
# spent 82µs (7+74) within vars::BEGIN@7 which was called: # once (7µs+74µs) by version::BEGIN@11 at line 7
use warnings::register;
# spent 82µs making 1 call to vars::BEGIN@7 # spent 74µs making 1 call to warnings::register::import
82312µs231µs
# spent 19µs (7+12) within vars::BEGIN@8 which was called: # once (7µs+12µs) by version::BEGIN@11 at line 8
use strict qw(vars subs);
# spent 19µs making 1 call to vars::BEGIN@8 # spent 12µs making 1 call to strict::import
9
10
# spent 441µs (347+94) within vars::import which was called 10 times, avg 44µs/call: # once (66µs+16µs) by version::BEGIN@11 at line 11 of version.pm # once (54µs+15µs) by DateTime::TimeZone::Catalog::BEGIN@12 at line 12 of DateTime/TimeZone/Catalog.pm # once (44µs+11µs) by Class::Inspector::BEGIN@50 at line 50 of Class/Inspector.pm # once (39µs+11µs) by version::regex::BEGIN@5 at line 5 of version/regex.pm # once (34µs+8µs) by Params::Validate::BEGIN@14 at line 14 of Params/Validate.pm # once (30µs+11µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (32µs+8µs) by version::vxs::BEGIN@7 at line 7 of version/vxs.pm # once (18µs+5µs) by base::BEGIN@5 at line 5 of base.pm # once (15µs+4µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm # once (14µs+4µs) by parent::BEGIN@3 at line 3 of parent.pm
sub import {
11109µs my $callpack = caller;
121017µs my (undef, @imports) = @_;
13103µs my ($sym, $ch);
141045µs foreach (@imports) {
1531164µs3165µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 65µs making 31 calls to vars::CORE:match, avg 2µs/call
163158µs3117µs if ($sym =~ /\W/) {
# spent 17µs making 31 calls to vars::CORE:match, avg 558ns/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 }
283167µs3112µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 12µs making 31 calls to vars::CORE:match, avg 374ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
353197µ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
4613µs1;
47__END__
 
# spent 94µs within vars::CORE:match which was called 93 times, avg 1µs/call: # 31 times (65µs+0s) by vars::import at line 15, avg 2µs/call # 31 times (17µs+0s) by vars::import at line 16, avg 558ns/call # 31 times (12µs+0s) by vars::import at line 28, avg 374ns/call
sub vars::CORE:match; # opcode