← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:42:38 2010
Reported on Wed Nov 17 22:04:41 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/vars.pm
StatementsExecuted 247 statements in 6.12ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1515152.98ms3.79msvars::::importvars::import
111935µs1.33msvars::::BEGIN@7vars::BEGIN@7
13231809µs809µsvars::::CORE:matchvars::CORE:match (opcode)
11197µs97µsvars::::BEGIN@3vars::BEGIN@3
11136µs108µ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
33188µs197µs
# spent 97µs within vars::BEGIN@3 which was called: # once (97µs+0s) by Scalar::Util::BEGIN@10 at line 3
use 5.006;
# spent 97µs making 1 call to vars::BEGIN@3
4
514µsour $VERSION = '1.01';
6
731.02ms21.73ms
# spent 1.33ms (935µs+396µs) within vars::BEGIN@7 which was called: # once (935µs+396µs) by Scalar::Util::BEGIN@10 at line 7
use warnings::register;
# spent 1.33ms making 1 call to vars::BEGIN@7 # spent 396µs making 1 call to warnings::register::import
831.01ms2181µs
# spent 108µs (36+72) within vars::BEGIN@8 which was called: # once (36µs+72µs) by Scalar::Util::BEGIN@10 at line 8
use strict qw(vars subs);
# spent 108µs making 1 call to vars::BEGIN@8 # spent 72µs making 1 call to strict::import
9
10
# spent 3.79ms (2.98+809µs) within vars::import which was called 15 times, avg 253µs/call: # once (330µs+88µs) by Time::HiRes::BEGIN@4 at line 4 of Time/HiRes.pm # once (310µs+100µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm # once (288µs+76µs) by Try::Tiny::BEGIN@6 at line 6 of Try/Tiny.pm # once (277µs+79µs) by List::Util::BEGIN@12 at line 12 of List/Util.pm # once (283µs+67µs) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm # once (242µs+63µs) by Set::Object::BEGIN@499 at line 499 of Set/Object.pm # once (236µs+65µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm # once (178µs+38µs) by Devel::GlobalDestruction::BEGIN@8 at line 8 of Devel/GlobalDestruction.pm # once (161µs+39µs) by Set::Object::Weak::BEGIN@31 at line 31 of Set/Object/Weak.pm # once (152µs+39µs) by Data::UUID::LibUUID::BEGIN@7 at line 7 of Data/UUID/LibUUID.pm # once (132µs+45µs) by constant::BEGIN@6 at line 6 of constant.pm # once (138µs+39µs) by Tie::ToObject::BEGIN@8 at line 8 of Tie/ToObject.pm # once (89µs+25µs) by namespace::clean::BEGIN@13 at line 13 of namespace/clean.pm # once (84µs+24µs) by base::BEGIN@4 at line 4 of base.pm # once (81µs+22µs) by Memoize::BEGIN@29 at line 29 of Memoize.pm
sub import {
112363.90ms my $callpack = caller;
12 my ($pack, @imports) = @_;
13 my ($sym, $ch);
14 foreach (@imports) {
1544513µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 513µs making 44 calls to vars::CORE:match, avg 12µs/call
1644158µs if ($sym =~ /\W/) {
# spent 158µs making 44 calls to vars::CORE:match, avg 4µ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 }
2844139µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 139µs making 44 calls to vars::CORE:match, avg 3µs/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35 : 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
46111µs1;
47__END__
 
# spent 809µs within vars::CORE:match which was called 132 times, avg 6µs/call: # 44 times (513µs+0s) by vars::import at line 15, avg 12µs/call # 44 times (158µs+0s) by vars::import at line 16, avg 4µs/call # 44 times (139µs+0s) by vars::import at line 28, avg 3µs/call
sub vars::CORE:match; # opcode