← Index
NYTProf Performance Profile   « line view »
For fastest.pl
  Run on Fri Jan 31 20:48:16 2014
Reported on Fri Jan 31 20:49:40 2014

Filename/opt/perl-5.18.1/lib/5.18.1/vars.pm
StatementsExecuted 88 statements in 1.00ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111258µs361µsvars::::BEGIN@7vars::BEGIN@7
666221µs268µsvars::::importvars::import
423147µs47µsvars::::CORE:matchvars::CORE:match (opcode)
11118µs18µsvars::::BEGIN@3vars::BEGIN@3
1118µs22µ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
3272µs118µs
# spent 18µs within vars::BEGIN@3 which was called: # once (18µs+0s) by base::BEGIN@4 at line 3
use 5.006;
# spent 18µs making 1 call to vars::BEGIN@3
4
51800nsour $VERSION = '1.03';
6
72281µs2464µs
# spent 361µs (258+103) within vars::BEGIN@7 which was called: # once (258µs+103µs) by base::BEGIN@4 at line 7
use warnings::register;
# spent 361µs making 1 call to vars::BEGIN@7 # spent 103µs making 1 call to warnings::register::import
82375µs236µs
# spent 22µs (8+14) within vars::BEGIN@8 which was called: # once (8µs+14µs) by base::BEGIN@4 at line 8
use strict qw(vars subs);
# spent 22µs making 1 call to vars::BEGIN@8 # spent 14µs making 1 call to strict::import
9
10
# spent 268µs (221+47) within vars::import which was called 6 times, avg 45µs/call: # once (57µs+11µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm # once (50µs+11µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm # once (32µs+7µs) by constant::BEGIN@6 at line 6 of constant.pm # once (31µs+6µs) by base::BEGIN@4 at line 4 of base.pm # once (28µs+7µs) by Config::BEGIN@11 at line 11 of Config.pm # once (22µs+5µs) by parent::BEGIN@3 at line 3 of parent.pm
sub import {
1166µs my $callpack = caller;
12610µs my (undef, @imports) = @_;
1361µs my ($sym, $ch);
14632µs foreach (@imports) {
1514110µs1435µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 35µs making 14 calls to vars::CORE:match, avg 3µs/call
161428µs147µs if ($sym =~ /\W/) {
# spent 7µs making 14 calls to vars::CORE:match, avg 471ns/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 }
281435µs146µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 6µs making 14 calls to vars::CORE:match, avg 393ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
351451µ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 47µs within vars::CORE:match which was called 42 times, avg 1µs/call: # 14 times (35µs+0s) by vars::import at line 15, avg 3µs/call # 14 times (7µs+0s) by vars::import at line 16, avg 471ns/call # 14 times (6µs+0s) by vars::import at line 28, avg 393ns/call
sub vars::CORE:match; # opcode