| Filename | /home/ss5/perl5/perlbrew/perls/tapper-perl/lib/5.16.3/vars.pm |
| Statements | Executed 452 statements in 1.54ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 30 | 30 | 24 | 877µs | 1.08ms | vars::import |
| 243 | 3 | 1 | 204µs | 204µs | vars::CORE:match (opcode) |
| 1 | 1 | 1 | 129µs | 189µs | vars::BEGIN@7 |
| 1 | 1 | 1 | 17µs | 17µs | vars::BEGIN@3 |
| 1 | 1 | 1 | 6µs | 15µs | vars::BEGIN@8 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package vars; | ||||
| 2 | |||||
| 3 | 2 | 63µs | 1 | 17µs | # spent 17µs within vars::BEGIN@3 which was called:
# once (17µs+0s) by Config::BEGIN@11 at line 3 # spent 17µs making 1 call to vars::BEGIN@3 |
| 4 | |||||
| 5 | 1 | 400ns | our $VERSION = '1.02'; | ||
| 6 | |||||
| 7 | 2 | 140µs | 2 | 248µs | # spent 189µs (129+60) within vars::BEGIN@7 which was called:
# once (129µs+60µs) by Config::BEGIN@11 at line 7 # spent 189µs making 1 call to vars::BEGIN@7
# spent 60µs making 1 call to warnings::register::import |
| 8 | 2 | 195µs | 2 | 24µs | # spent 15µs (6+9) within vars::BEGIN@8 which was called:
# once (6µs+9µs) by Config::BEGIN@11 at line 8 # spent 15µs making 1 call to vars::BEGIN@8
# spent 9µs making 1 call to strict::import |
| 9 | |||||
| 10 | # spent 1.08ms (877µs+204µs) within vars::import which was called 30 times, avg 36µs/call:
# once (75µs+14µs) by Getopt::Long::BEGIN@45 at line 45 of Getopt/Long.pm
# once (64µs+22µs) by Cwd::BEGIN@172 at line 172 of Cwd.pm
# once (56µs+12µs) by Config::Perl::V::BEGIN@10 at line 10 of Config/Perl/V.pm
# once (46µs+9µs) by Getopt::Long::BEGIN@48 at line 48 of Getopt/Long.pm
# once (46µs+9µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm
# once (42µs+10µs) by Data::Structure::Util::BEGIN@7 at line 7 of Data/Structure/Util.pm
# once (41µs+9µs) by Getopt::Long::BEGIN@51 at line 51 of Getopt/Long.pm
# once (37µs+9µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm
# once (37µs+8µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm
# once (32µs+6µs) by Storable::BEGIN@22 at line 22 of Storable.pm
# once (31µs+7µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm
# once (30µs+6µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm
# once (30µs+6µs) by Sys::Info::Constants::BEGIN@4 at line 4 of Sys/Info/Constants.pm
# once (28µs+7µs) by Text::Balanced::BEGIN@11 at line 11 of Text/Balanced.pm
# once (26µs+6µs) by Iterator::Util::BEGIN@21 at line 21 of Iterator/Util.pm
# once (26µs+6µs) by Getopt::Long::BEGIN@26 at line 26 of Getopt/Long.pm
# once (22µs+6µs) by Sys::Info::BEGIN@4 at line 4 of Sys/Info.pm
# once (23µs+4µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
# once (19µs+5µs) by constant::BEGIN@6 at line 6 of constant.pm
# once (18µs+4µs) by SelfLoader::BEGIN@9 at line 9 of SelfLoader.pm
# once (16µs+5µs) by Devel::Platform::Info::BEGIN@6 at line 6 of Devel/Platform/Info.pm
# once (17µs+4µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm
# once (18µs+4µs) by Config::BEGIN@11 at line 11 of Config.pm
# once (15µs+5µs) by Config::BEGIN@7 at line 7 of Config_heavy.pl
# once (15µs+3µs) by Data::YAML::Writer::BEGIN@7 at line 7 of Data/YAML/Writer.pm
# once (13µs+5µs) by Class::Data::Inheritable::BEGIN@4 at line 4 of Class/Data/Inheritable.pm
# once (13µs+4µs) by Getopt::Long::BEGIN@19 at line 19 of Getopt/Long.pm
# once (14µs+3µs) by Sys::Info::Base::BEGIN@4 at line 4 of Sys/Info/Base.pm
# once (12µs+3µs) by base::BEGIN@4 at line 4 of base.pm
# once (11µs+2µs) by Getopt::Long::BEGIN@22 at line 22 of Getopt/Long.pm | ||||
| 11 | 30 | 21µs | my $callpack = caller; | ||
| 12 | 30 | 43µs | my (undef, @imports) = @_; | ||
| 13 | 30 | 8µs | my ($sym, $ch); | ||
| 14 | 30 | 123µs | foreach (@imports) { | ||
| 15 | 81 | 419µs | 81 | 142µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 142µs making 81 calls to vars::CORE:match, avg 2µs/call |
| 16 | 81 | 133µs | 81 | 35µs | if ($sym =~ /\W/) { # spent 35µs making 81 calls to vars::CORE:match, avg 435ns/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 | } | ||||
| 28 | 81 | 148µs | 81 | 26µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 26µs making 81 calls to vars::CORE:match, avg 325ns/call |
| 29 | *$sym = | ||||
| 30 | ( $ch eq "\$" ? \$$sym | ||||
| 31 | : $ch eq "\@" ? \@$sym | ||||
| 32 | : $ch eq "\%" ? \%$sym | ||||
| 33 | : $ch eq "\*" ? \*$sym | ||||
| 34 | : $ch eq "\&" ? \&$sym | ||||
| 35 | 81 | 246µ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 | |||||
| 46 | 1 | 2µs | 1; | ||
| 47 | __END__ | ||||
sub vars::CORE:match; # opcode |