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

Filename/home/s1/perl5/perlbrew/perls/perl-5.22.1/lib/5.22.1/vars.pm
StatementsExecuted 152 statements in 1.08ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
999390µs493µsvars::::importvars::import
8131103µs103µsvars::::CORE:matchvars::CORE:match (opcode)
11127µs27µsvars::::BEGIN@3vars::BEGIN@3
11110µs109µsvars::::BEGIN@7vars::BEGIN@7
1119µs25µ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
3293µs127µs
# spent 27µs within vars::BEGIN@3 which was called: # once (27µs+0s) by version::BEGIN@11 at line 3
use 5.006;
# spent 27µs making 1 call to vars::BEGIN@3
4
51700nsour $VERSION = '1.03';
6
7241µs2209µs
# spent 109µs (10+99) within vars::BEGIN@7 which was called: # once (10µs+99µs) by version::BEGIN@11 at line 7
use warnings::register;
# spent 109µs making 1 call to vars::BEGIN@7 # spent 99µs making 1 call to warnings::register::import
82430µs241µs
# spent 25µs (9+16) within vars::BEGIN@8 which was called: # once (9µs+16µs) by version::BEGIN@11 at line 8
use strict qw(vars subs);
# spent 25µs making 1 call to vars::BEGIN@8 # spent 16µs making 1 call to strict::import
9
10
# spent 493µs (390+103) within vars::import which was called 9 times, avg 55µs/call: # once (88µs+22µs) by version::BEGIN@11 at line 11 of version.pm # once (63µs+18µs) by DateTime::TimeZone::Catalog::BEGIN@12 at line 12 of DateTime/TimeZone/Catalog.pm # once (54µs+15µs) by version::regex::BEGIN@5 at line 5 of version/regex.pm # once (49µs+12µs) by Params::Validate::BEGIN@14 at line 14 of Params/Validate.pm # once (42µs+11µs) by version::vxs::BEGIN@7 at line 7 of version/vxs.pm # once (31µs+8µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (22µs+6µs) by base::BEGIN@5 at line 5 of base.pm # once (20µs+6µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm # once (19µs+5µs) by parent::BEGIN@3 at line 3 of parent.pm
sub import {
11910µs my $callpack = caller;
12921µs my (undef, @imports) = @_;
1393µs my ($sym, $ch);
14952µs foreach (@imports) {
1527184µs2772µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 72µs making 27 calls to vars::CORE:match, avg 3µs/call
162761µs2718µs if ($sym =~ /\W/) {
# spent 18µs making 27 calls to vars::CORE:match, avg 659ns/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 }
282773µs2713µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 13µs making 27 calls to vars::CORE:match, avg 467ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
3527111µ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
4614µs1;
47__END__
 
# spent 103µs within vars::CORE:match which was called 81 times, avg 1µs/call: # 27 times (72µs+0s) by vars::import at line 15, avg 3µs/call # 27 times (18µs+0s) by vars::import at line 16, avg 659ns/call # 27 times (13µs+0s) by vars::import at line 28, avg 467ns/call
sub vars::CORE:match; # opcode