← Index
NYTProf Performance Profile   « line view »
For index.cgi
  Run on Sat May 9 17:18:47 2020
Reported on Sat May 9 17:19:07 2020

Filename/usr/share/perl/5.18/vars.pm
StatementsExecuted 84 statements in 977µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111245µs353µsvars::::BEGIN@7vars::BEGIN@7
666213µs265µsvars::::importvars::import
393151µs51µsvars::::CORE:matchvars::CORE:match (opcode)
11119µs19µsvars::::BEGIN@3vars::BEGIN@3
11110µ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
3265µs119µs
# spent 19µs within vars::BEGIN@3 which was called: # once (19µs+0s) by Config::BEGIN@11 at line 3
use 5.006;
# spent 19µs making 1 call to vars::BEGIN@3
4
51800nsour $VERSION = '1.03';
6
72271µs2461µs
# spent 353µs (245+108) within vars::BEGIN@7 which was called: # once (245µs+108µs) by Config::BEGIN@11 at line 7
use warnings::register;
# spent 353µs making 1 call to vars::BEGIN@7 # spent 108µs making 1 call to warnings::register::import
82362µs240µs
# spent 25µs (10+15) within vars::BEGIN@8 which was called: # once (10µs+15µs) by Config::BEGIN@11 at line 8
use strict qw(vars subs);
# spent 25µs making 1 call to vars::BEGIN@8 # spent 15µs making 1 call to strict::import
9
10
# spent 265µs (213+51) within vars::import which was called 6 times, avg 44µs/call: # once (54µs+14µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm # once (46µs+11µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm # once (37µs+9µs) by Config::BEGIN@11 at line 11 of Config.pm # once (30µs+8µs) by constant::BEGIN@6 at line 6 of constant.pm # once (26µs+5µs) by base::BEGIN@4 at line 4 of base.pm # once (19µs+5µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm
sub import {
1166µs my $callpack = caller;
12611µs my (undef, @imports) = @_;
1362µs my ($sym, $ch);
14629µs foreach (@imports) {
1513104µs1336µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 36µs making 13 calls to vars::CORE:match, avg 3µs/call
161332µs139µs if ($sym =~ /\W/) {
# spent 9µs making 13 calls to vars::CORE:match, avg 692ns/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 }
281336µs136µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 6µs making 13 calls to vars::CORE:match, avg 500ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
351355µ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
4613µs1;
47__END__
 
# spent 51µs within vars::CORE:match which was called 39 times, avg 1µs/call: # 13 times (36µs+0s) by vars::import at line 15, avg 3µs/call # 13 times (9µs+0s) by vars::import at line 16, avg 692ns/call # 13 times (6µs+0s) by vars::import at line 28, avg 500ns/call
sub vars::CORE:match; # opcode