← Index
NYTProf Performance Profile   « line view »
For t/optimization.t
  Run on Thu Jan 8 22:47:42 2015
Reported on Thu Jan 8 22:48:05 2015

Filename/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/5.16.3/vars.pm
StatementsExecuted 144 statements in 1.03ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111111358µs441µsvars::::importvars::import
111190µs279µsvars::::BEGIN@7vars::BEGIN@7
693182µs82µsvars::::CORE:matchvars::CORE:match (opcode)
11116µs16µsvars::::BEGIN@3vars::BEGIN@3
1119µs21µ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
3262µs116µs
# spent 16µs within vars::BEGIN@3 which was called: # once (16µs+0s) by Config::BEGIN@11 at line 3
use 5.006;
# spent 16µs making 1 call to vars::BEGIN@3
4
51700nsour $VERSION = '1.02';
6
72209µs2368µs
# spent 279µs (190+89) within vars::BEGIN@7 which was called: # once (190µs+89µs) by Config::BEGIN@11 at line 7
use warnings::register;
# spent 279µs making 1 call to vars::BEGIN@7 # spent 89µs making 1 call to warnings::register::import
82287µs234µs
# spent 21µs (9+13) within vars::BEGIN@8 which was called: # once (9µs+13µs) by Config::BEGIN@11 at line 8
use strict qw(vars subs);
# spent 21µs making 1 call to vars::BEGIN@8 # spent 13µs making 1 call to strict::import
9
10
# spent 441µs (358+82) within vars::import which was called 11 times, avg 40µs/call: # once (56µs+13µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm # once (53µs+12µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm # once (41µs+9µs) by Text::Balanced::BEGIN@11 at line 11 of Text/Balanced.pm # once (39µs+10µs) by Iterator::Util::BEGIN@21 at line 21 of Iterator/Util.pm # once (34µs+8µs) by constant::BEGIN@6 at line 6 of constant.pm # once (30µs+7µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (26µs+5µs) by Config::BEGIN@11 at line 11 of Config.pm # once (24µs+5µs) by SelfLoader::BEGIN@9 at line 9 of SelfLoader.pm # once (19µs+5µs) by base::BEGIN@4 at line 4 of base.pm # once (19µs+4µs) by Class::Data::Inheritable::BEGIN@4 at line 4 of Class/Data/Inheritable.pm # once (18µs+4µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
sub import {
111110µs my $callpack = caller;
121120µs my (undef, @imports) = @_;
13114µs my ($sym, $ch);
141160µs foreach (@imports) {
1523171µs2357µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 57µs making 23 calls to vars::CORE:match, avg 2µs/call
162354µs2314µs if ($sym =~ /\W/) {
# spent 14µs making 23 calls to vars::CORE:match, avg 630ns/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 }
282360µs2311µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 11µs making 23 calls to vars::CORE:match, avg 478ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
352393µ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 82µs within vars::CORE:match which was called 69 times, avg 1µs/call: # 23 times (57µs+0s) by vars::import at line 15, avg 2µs/call # 23 times (14µs+0s) by vars::import at line 16, avg 630ns/call # 23 times (11µs+0s) by vars::import at line 28, avg 478ns/call
sub vars::CORE:match; # opcode