← Index
NYTProf Performance Profile   « line view »
For /usr/sbin/pkg_info
  Run on Fri Aug 4 10:12:01 2017
Reported on Fri Aug 4 10:12:17 2017

Filename/usr/libdata/perl5/vars.pm
StatementsExecuted 68 statements in 685µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
444179µs230µsvars::::importvars::import
333151µs51µsvars::::CORE:matchvars::CORE:match (opcode)
11134µs34µsvars::::BEGIN@3vars::BEGIN@3
11114µs242µsvars::::BEGIN@7vars::BEGIN@7
1118µs34µ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
3268µs134µs
# spent 34µs within vars::BEGIN@3 which was called: # once (34µs+0s) by File::Spec::BEGIN@4 at line 3
use 5.006;
# spent 34µs making 1 call to vars::BEGIN@3
4
51900nsour $VERSION = '1.03';
6
7237µs2470µs
# spent 242µs (14+228) within vars::BEGIN@7 which was called: # once (14µs+228µs) by File::Spec::BEGIN@4 at line 7
use warnings::register;
# spent 242µs making 1 call to vars::BEGIN@7 # spent 228µs making 1 call to warnings::register::import
82332µs260µs
# spent 34µs (8+26) within vars::BEGIN@8 which was called: # once (8µs+26µs) by File::Spec::BEGIN@4 at line 8
use strict qw(vars subs);
# spent 34µs making 1 call to vars::BEGIN@8 # spent 26µs making 1 call to strict::import
9
10
# spent 230µs (179+51) within vars::import which was called 4 times, avg 57µs/call: # once (67µs+24µs) by Cwd::BEGIN@4 at line 4 of Cwd.pm # once (55µs+14µs) by File::Path::BEGIN@20 at line 20 of File/Path.pm # once (38µs+9µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (19µs+4µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
sub import {
1145µs my $callpack = caller;
1248µs my (undef, @imports) = @_;
1343µs my ($sym, $ch);
14422µs foreach (@imports) {
151184µs1130µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 30µs making 11 calls to vars::CORE:match, avg 3µs/call
161134µs1110µs if ($sym =~ /\W/) {
# spent 10µs making 11 calls to vars::CORE:match, avg 882ns/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 }
281143µs1112µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 12µs making 11 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
351135µ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
46113µs1;
47__END__
 
# spent 51µs within vars::CORE:match which was called 33 times, avg 2µs/call: # 11 times (30µs+0s) by vars::import at line 15, avg 3µs/call # 11 times (12µs+0s) by vars::import at line 28, avg 1µs/call # 11 times (10µs+0s) by vars::import at line 16, avg 882ns/call
sub vars::CORE:match; # opcode