← Index
NYTProf Performance Profile   « line view »
For /Users/brian/bin/perls/cpan5.26.1
  Run on Sat Dec 30 01:41:10 2017
Reported on Sat Dec 30 01:44:14 2017

Filename/usr/local/perls/perl-5.26.1/lib/5.26.1/vars.pm
StatementsExecuted 188 statements in 1.46ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
101091.10ms1.42msvars::::importvars::import
11131327µs327µsvars::::CORE:matchvars::CORE:match (opcode)
0000s0svars::::BEGINvars::BEGIN
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
3use 5.006;
4
5our $VERSION = '1.03';
6
7use warnings::register;
8use strict qw(vars subs);
9
10
# spent 1.42ms (1.10+327µs) within vars::import which was called 10 times, avg 142µs/call: # once (554µs+167µs) by Archive::Tar::BEGIN@24 at line 27 of Archive/Tar.pm # once (136µs+23µs) by parent::BEGIN@3 at line 3 of parent.pm # once (74µs+16µs) by Term::Cap::BEGIN@20 at line 20 of Term/Cap.pm # once (68µs+21µs) by IO::Zlib::BEGIN@289 at line 289 of IO/Zlib.pm # once (68µs+20µs) by Storable::BEGIN@23 at line 23 of Storable.pm # once (47µs+19µs) by Term::Cap::BEGIN@19 at line 19 of Term/Cap.pm # once (43µs+17µs) by Digest::SHA::BEGIN@7 at line 7 of Digest/SHA.pm # once (41µs+15µs) by Tie::StdHandle::BEGIN@6 at line 6 of Tie/StdHandle.pm # once (37µs+15µs) by Archive::Tar::File::BEGIN@14 at line 14 of Archive/Tar/File.pm # once (29µs+14µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm
sub import {
111026µs my $callpack = caller;
121030µs my (undef, @imports) = @_;
13108µs my ($sym, $ch);
141099µs foreach (@imports) {
1537612µs37224µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 224µs making 37 calls to vars::CORE:match, avg 6µs/call
1637141µs3762µs if ($sym =~ /\W/) {
# spent 62µs making 37 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 }
2837194µs3741µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 41µs making 37 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
3537349µ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
461;
47__END__
 
# spent 327µs within vars::CORE:match which was called 111 times, avg 3µs/call: # 37 times (224µs+0s) by vars::import at line 15, avg 6µs/call # 37 times (62µs+0s) by vars::import at line 16, avg 2µs/call # 37 times (41µs+0s) by vars::import at line 28, avg 1µs/call
sub vars::CORE:match; # opcode