← Index
NYTProf Performance Profile   « line view »
For /usr/sbin/pkg_info
  Run on Fri Aug 4 10:15:59 2017
Reported on Fri Aug 4 10:16:18 2017

Filename/usr/libdata/perl5/vars.pm
StatementsExecuted 28 statements in 576µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
22271µs86µsvars::::importvars::import
11125µs25µsvars::::BEGIN@3vars::BEGIN@3
93114µs14µsvars::::CORE:matchvars::CORE:match (opcode)
11114µs234µsvars::::BEGIN@7vars::BEGIN@7
1118µs35µ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
3276µs125µs
# spent 25µs within vars::BEGIN@3 which was called: # once (25µs+0s) by File::Spec::BEGIN@4 at line 3
use 5.006;
# spent 25µs making 1 call to vars::BEGIN@3
4
51900nsour $VERSION = '1.03';
6
7236µs2455µs
# spent 234µs (14+221) within vars::BEGIN@7 which was called: # once (14µs+221µs) by File::Spec::BEGIN@4 at line 7
use warnings::register;
# spent 234µs making 1 call to vars::BEGIN@7 # spent 221µs making 1 call to warnings::register::import
82370µs262µs
# spent 35µs (8+27) within vars::BEGIN@8 which was called: # once (8µs+27µs) by File::Spec::BEGIN@4 at line 8
use strict qw(vars subs);
# spent 35µs making 1 call to vars::BEGIN@8 # spent 27µs making 1 call to strict::import
9
10
# spent 86µs (71+14) within vars::import which was called 2 times, avg 43µs/call: # once (39µs+10µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (32µs+5µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
sub import {
1122µs my $callpack = caller;
12214µs my (undef, @imports) = @_;
1321µs my ($sym, $ch);
14210µs foreach (@imports) {
15328µs39µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 9µs making 3 calls to vars::CORE:match, avg 3µs/call
16310µs33µs if ($sym =~ /\W/) {
# spent 3µs making 3 calls to vars::CORE:match, avg 900ns/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 }
28312µs32µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 2µs making 3 calls to vars::CORE:match, avg 800ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35311µ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 14µs within vars::CORE:match which was called 9 times, avg 2µs/call: # 3 times (9µs+0s) by vars::import at line 15, avg 3µs/call # 3 times (3µs+0s) by vars::import at line 16, avg 900ns/call # 3 times (2µs+0s) by vars::import at line 28, avg 800ns/call
sub vars::CORE:match; # opcode