← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Sun Aug 5 15:24:32 2012
Reported on Sun Aug 5 15:24:57 2012

Filename/usr/lib/perl5/5.12.4/vars.pm
StatementsExecuted 259 statements in 8.66ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1616164.22ms5.33msvars::::importvars::import
1111.34ms2.00msvars::::BEGIN@7vars::BEGIN@7
138311.11ms1.11msvars::::CORE:matchvars::CORE:match (opcode)
111143µs143µsvars::::BEGIN@3vars::BEGIN@3
11148µs168µ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
33308µs1143µs
# spent 143µs within vars::BEGIN@3 which was called: # once (143µs+0s) by Scalar::Util::BEGIN@10 at line 3
use 5.006;
# spent 143µs making 1 call to vars::BEGIN@3
4
515µsour $VERSION = '1.01';
6
731.43ms22.66ms
# spent 2.00ms (1.34+658µs) within vars::BEGIN@7 which was called: # once (1.34ms+658µs) by Scalar::Util::BEGIN@10 at line 7
use warnings::register;
# spent 2.00ms making 1 call to vars::BEGIN@7 # spent 658µs making 1 call to warnings::register::import
831.43ms2289µs
# spent 168µs (48+121) within vars::BEGIN@8 which was called: # once (48µs+121µs) by Scalar::Util::BEGIN@10 at line 8
use strict qw(vars subs);
# spent 168µs making 1 call to vars::BEGIN@8 # spent 121µs making 1 call to strict::import
9
10
# spent 5.33ms (4.22+1.11) within vars::import which was called 16 times, avg 333µs/call: # once (456µs+114µs) by DateTime::TimeZone::Catalog::BEGIN@12 at line 12 of DateTime/TimeZone/Catalog.pm # once (413µs+131µs) by Math::Round::BEGIN@5 at line 5 of Math/Round.pm # once (409µs+109µs) by List::Util::BEGIN@12 at line 12 of List/Util.pm # once (406µs+111µs) by POSIX::SigRt::BEGIN@66 at line 66 of POSIX.pm # once (388µs+91µs) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm # once (364µs+91µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm # once (330µs+89µs) by Try::Tiny::BEGIN@6 at line 6 of Try/Tiny.pm # once (252µs+69µs) by Params::Validate::BEGIN@15 at line 15 of Params/Validate.pm # once (241µs+54µs) by DateTime::TimeZone::Floating::BEGIN@5 at line 5 of DateTime/TimeZone/Floating.pm # once (190µs+47µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (180µs+52µs) by constant::BEGIN@6 at line 6 of constant.pm # once (121µs+31µs) by DateTime::TimeZone::OffsetOnly::BEGIN@5 at line 5 of DateTime/TimeZone/OffsetOnly.pm # once (122µs+29µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm # once (118µs+29µs) by DateTime::TimeZone::UTC::BEGIN@5 at line 5 of DateTime/TimeZone/UTC.pm # once (116µs+31µs) by DateTime::TimeZone::Local::BEGIN@6 at line 6 of DateTime/TimeZone/Local.pm # once (115µs+30µs) by base::BEGIN@4 at line 4 of base.pm
sub import {
1116123µs my $callpack = caller;
1216194µs my ($pack, @imports) = @_;
131652µs my ($sym, $ch);
1416473µs foreach (@imports) {
15461.97ms46687µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 687µs making 46 calls to vars::CORE:match, avg 15µs/call
1646773µs46230µs if ($sym =~ /\W/) {
# spent 230µs making 46 calls to vars::CORE:match, avg 5µs/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 }
2846813µs46190µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 190µs making 46 calls to vars::CORE:match, avg 4µs/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35461.08ms : 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
46115µs1;
47__END__
 
# spent 1.11ms within vars::CORE:match which was called 138 times, avg 8µs/call: # 46 times (687µs+0s) by vars::import at line 15, avg 15µs/call # 46 times (230µs+0s) by vars::import at line 16, avg 5µs/call # 46 times (190µs+0s) by vars::import at line 28, avg 4µs/call
sub vars::CORE:match; # opcode