← Index
NYTProf Performance Profile   « line view »
For /usr/sbin/pkg_info
  Run on Mon Aug 7 09:39:31 2017
Reported on Mon Aug 7 09:40:21 2017

Filename/usr/libdata/perl5/vars.pm
StatementsExecuted 68 statements in 692µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
444180µs223µsvars::::importvars::import
333143µs43µsvars::::CORE:matchvars::CORE:match (opcode)
11117µs17µsvars::::BEGIN@3vars::BEGIN@3
11113µs251µsvars::::BEGIN@7vars::BEGIN@7
1118µs32µ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
3258µs117µs
# spent 17µs within vars::BEGIN@3 which was called: # once (17µs+0s) by Cwd::BEGIN@4 at line 3
use 5.006;
# spent 17µs making 1 call to vars::BEGIN@3
4
51900nsour $VERSION = '1.03';
6
7236µs2488µs
# spent 251µs (13+238) within vars::BEGIN@7 which was called: # once (13µs+238µs) by Cwd::BEGIN@4 at line 7
use warnings::register;
# spent 251µs making 1 call to vars::BEGIN@7 # spent 238µs making 1 call to warnings::register::import
82362µs256µs
# spent 32µs (8+24) within vars::BEGIN@8 which was called: # once (8µs+24µs) by Cwd::BEGIN@4 at line 8
use strict qw(vars subs);
# spent 32µs making 1 call to vars::BEGIN@8 # spent 24µs making 1 call to strict::import
9
10
# spent 223µs (180+43) within vars::import which was called 4 times, avg 56µs/call: # once (70µs+16µs) by Cwd::BEGIN@4 at line 4 of Cwd.pm # once (58µs+14µs) by File::Path::BEGIN@20 at line 20 of File/Path.pm # once (32µs+8µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (20µs+5µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
sub import {
1145µs my $callpack = caller;
1247µs my (undef, @imports) = @_;
1342µs my ($sym, $ch);
14421µs foreach (@imports) {
151185µs1126µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 26µs making 11 calls to vars::CORE:match, avg 2µs/call
161133µs119µs if ($sym =~ /\W/) {
# spent 9µs making 11 calls to vars::CORE:match, avg 818ns/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 }
281140µs118µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 8µs making 11 calls to vars::CORE:match, avg 755ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
351138µ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
4615µs1;
47__END__
 
# spent 43µs within vars::CORE:match which was called 33 times, avg 1µs/call: # 11 times (26µs+0s) by vars::import at line 15, avg 2µs/call # 11 times (9µs+0s) by vars::import at line 16, avg 818ns/call # 11 times (8µs+0s) by vars::import at line 28, avg 755ns/call
sub vars::CORE:match; # opcode