← Index
NYTProf Performance Profile   « line view »
For opt.pl
  Run on Wed May 13 13:47:05 2015
Reported on Wed May 13 13:47:06 2015

Filename/home/lbr/.plenv/versions/5.20.2/lib/perl5/5.20.2/vars.pm
StatementsExecuted 32 statements in 479µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111148µs224µsvars::::BEGIN@7vars::BEGIN@7
22243µs53µsvars::::importvars::import
11115µs15µsvars::::BEGIN@3vars::BEGIN@3
123110µs10µsvars::::CORE:matchvars::CORE:match (opcode)
1115µs15µ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
3243µs115µs
# spent 15µs within vars::BEGIN@3 which was called: # once (15µs+0s) by Config::BEGIN@11 at line 3
use 5.006;
# spent 15µs making 1 call to vars::BEGIN@3
4
51300nsour $VERSION = '1.03';
6
72162µs2301µs
# spent 224µs (148+77) within vars::BEGIN@7 which was called: # once (148µs+77µs) by Config::BEGIN@11 at line 7
use warnings::register;
# spent 224µs making 1 call to vars::BEGIN@7 # spent 77µs making 1 call to warnings::register::import
82217µs224µs
# spent 15µs (5+10) within vars::BEGIN@8 which was called: # once (5µs+10µs) by Config::BEGIN@11 at line 8
use strict qw(vars subs);
# spent 15µs making 1 call to vars::BEGIN@8 # spent 10µs making 1 call to strict::import
9
10
# spent 53µs (43+10) within vars::import which was called 2 times, avg 26µs/call: # once (24µs+5µs) by Config::BEGIN@11 at line 11 of Config.pm # once (18µs+5µs) by constant::BEGIN@6 at line 6 of constant.pm
sub import {
1121µs my $callpack = caller;
1222µs my (undef, @imports) = @_;
132500ns my ($sym, $ch);
1426µs foreach (@imports) {
15422µs47µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 7µs making 4 calls to vars::CORE:match, avg 2µs/call
1647µs42µs if ($sym =~ /\W/) {
# spent 2µs making 4 calls to vars::CORE:match, avg 525ns/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 }
2847µs41µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 1µs making 4 calls to vars::CORE:match, avg 250ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35410µ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
4612µs1;
47__END__
 
# spent 10µs within vars::CORE:match which was called 12 times, avg 842ns/call: # 4 times (7µs+0s) by vars::import at line 15, avg 2µs/call # 4 times (2µs+0s) by vars::import at line 16, avg 525ns/call # 4 times (1µs+0s) by vars::import at line 28, avg 250ns/call
sub vars::CORE:match; # opcode