Filename | /usr/share/perl/5.14/vars.pm |
Statements | Executed 992 statements in 5.00ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
62 | 62 | 55 | 2.95ms | 3.70ms | import | vars::
552 | 3 | 1 | 757µs | 757µs | CORE:match (opcode) | vars::
1 | 1 | 1 | 378µs | 536µs | BEGIN@7 | vars::
1 | 1 | 1 | 68µs | 68µs | BEGIN@3 | vars::
1 | 1 | 1 | 13µs | 37µs | BEGIN@8 | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 2 | 149µs | 1 | 68µs | # spent 68µs within vars::BEGIN@3 which was called:
# once (68µs+0s) by Time::HiRes::BEGIN@4 at line 3 # spent 68µs making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 1µs | our $VERSION = '1.02'; | ||
6 | |||||
7 | 2 | 420µs | 2 | 693µs | # spent 536µs (378+157) within vars::BEGIN@7 which was called:
# once (378µs+157µs) by Time::HiRes::BEGIN@4 at line 7 # spent 536µs making 1 call to vars::BEGIN@7
# spent 157µs making 1 call to warnings::register::import |
8 | 2 | 563µs | 2 | 60µs | # spent 37µs (13+24) within vars::BEGIN@8 which was called:
# once (13µs+24µs) by Time::HiRes::BEGIN@4 at line 8 # spent 37µs making 1 call to vars::BEGIN@8
# spent 24µs making 1 call to strict::import |
9 | |||||
10 | # spent 3.70ms (2.95+757µs) within vars::import which was called 62 times, avg 60µs/call:
# once (167µs+43µs) by Math::BigInt::BEGIN@28 at line 28 of Math/BigInt.pm
# once (165µs+42µs) by Value::Convertor::BEGIN@154 at line 154 of Value/Convertor.pm
# once (156µs+34µs) by Time::HiRes::BEGIN@4 at line 4 of Time/HiRes.pm
# once (108µs+28µs) by POSIX::SigRt::BEGIN@60 at line 60 of POSIX.pm
# once (106µs+27µs) by DateTime::TimeZone::Catalog::BEGIN@18 at line 18 of DateTime/TimeZone/Catalog.pm
# once (88µs+33µs) by Time::Local::BEGIN@8 at line 8 of Time/Local.pm
# once (97µs+23µs) by DateTime::TimeZone::OlsonDB::BEGIN@12 at line 12 of DateTime/TimeZone/OlsonDB.pm
# once (92µs+24µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm
# once (91µs+22µs) by Time::Zone::BEGIN@149 at line 148 of Time/Zone.pm
# once (90µs+23µs) by Time::Zone::BEGIN@47 at line 47 of Time/Zone.pm
# once (89µs+23µs) by Mail::Sendmail::BEGIN@39 at line 39 of Mail/Sendmail.pm
# once (88µs+23µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm
# once (85µs+22µs) by Date::Parse::BEGIN@207 at line 207 of Date/Parse.pm
# once (81µs+22µs) by Cwd::BEGIN@5 at line 5 of Cwd.pm
# once (69µs+19µs) by Date::Parse::BEGIN@9 at line 9 of Date/Parse.pm
# once (68µs+18µs) by Params::Validate::BEGIN@15 at line 15 of Params/Validate.pm
# once (64µs+19µs) by bigint::BEGIN@18 at line 18 of bigint.pm
# once (59µs+14µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm
# once (47µs+13µs) by constant::BEGIN@6 at line 6 of constant.pm
# once (44µs+11µs) by Sys::Hostname::Long::BEGIN@12 at line 12 of Sys/Hostname/Long.pm
# once (42µs+11µs) by Clone::BEGIN@6 at line 6 of Clone.pm
# once (40µs+9µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm
# once (39µs+9µs) by Log::Writer::Syslog::BEGIN@83 at line 83 of Log/Writer/Syslog.pm
# once (36µs+10µs) by Readonly::BEGIN@171 at line 171 of Readonly.pm
# once (35µs+9µs) by MIME::Base64::BEGIN@4 at line 4 of MIME/Base64.pm
# once (34µs+9µs) by Net::CIDR::Lite::BEGIN@4 at line 4 of Net/CIDR/Lite.pm
# once (33µs+9µs) by Config::BEGIN@11 at line 11 of Config.pm
# once (33µs+9µs) by base::BEGIN@4 at line 4 of base.pm
# once (33µs+9µs) by parent::BEGIN@3 at line 3 of parent.pm
# once (33µs+8µs) by Time::Zone::BEGIN@59 at line 59 of Time/Zone.pm
# once (31µs+8µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
# once (30µs+8µs) by Log::Writer::Handle::BEGIN@125 at line 125 of Log/Writer/Handle.pm
# once (30µs+7µs) by Mentat::Storage::Mongo::BEGIN@195 at line 195 of Mentat/Storage/Mongo.pm
# once (30µs+8µs) by Log::Writer::Email::BEGIN@83 at line 83 of Log/Writer/Email.pm
# once (30µs+8µs) by MIME::QuotedPrint::BEGIN@4 at line 4 of MIME/QuotedPrint.pm
# once (30µs+8µs) by Storable::BEGIN@22 at line 22 of Storable.pm
# once (29µs+7µs) by Log::Writer::File::BEGIN@78 at line 78 of Log/Writer/File.pm
# once (29µs+7µs) by Log::Writer::Std::BEGIN@76 at line 76 of Log/Writer/Std.pm
# once (28µs+8µs) by Readonly::XS::BEGIN@20 at line 20 of Readonly/XS.pm
# once (28µs+6µs) by Log::Filter::Re::BEGIN@90 at line 90 of Log/Filter/Re.pm
# once (26µs+6µs) by Readonly::BEGIN@35 at line 35 of Readonly.pm
# once (26µs+6µs) by Log::Filter::Source::BEGIN@79 at line 79 of Log/Filter/Source.pm
# once (25µs+6µs) by Log::Filter::Threshold::BEGIN@91 at line 91 of Log/Filter/Threshold.pm
# once (25µs+6µs) by Log::Filter::None::BEGIN@75 at line 75 of Log/Filter/None.pm
# once (24µs+6µs) by Mentat::Storage::BEGIN@82 at line 82 of Mentat/Storage.pm
# once (24µs+6µs) by Log::Core::Essentials::BEGIN@79 at line 79 of Log/Core/Essentials.pm
# once (23µs+6µs) by Log::Filter::All::BEGIN@75 at line 75 of Log/Filter/All.pm
# once (23µs+6µs) by Log::Channel::Channel::BEGIN@78 at line 78 of Log/Channel/Channel.pm
# once (22µs+6µs) by Log::Filter::Message::BEGIN@80 at line 80 of Log/Filter/Message.pm
# once (22µs+6µs) by Log::Writer::Module::BEGIN@73 at line 73 of Log/Writer/Module.pm
# once (22µs+5µs) by Log::Filter::Severity::BEGIN@79 at line 79 of Log/Filter/Severity.pm
# once (22µs+6µs) by Log::Filter::Set::BEGIN@88 at line 88 of Log/Filter/Set.pm
# once (22µs+6µs) by Tie::IxHash::BEGIN@15 at line 15 of Tie/IxHash.pm
# once (19µs+4µs) by Readonly::BEGIN@32 at line 32 of Readonly.pm
# once (18µs+4µs) by Mail::Sendmail::BEGIN@183 at line 183 of Mail/Sendmail.pm
# once (16µs+4µs) by Log::Loger::BEGIN@140 at line 140 of Log/Loger.pm
# once (14µs+4µs) by Log::Filter::Module::BEGIN@81 at line 81 of Log/Filter/Module.pm
# once (14µs+4µs) by Sys::Syslog::BEGIN@78 at line 78 of Sys/Syslog.pm
# once (14µs+4µs) by Log::Channel::Module::BEGIN@79 at line 79 of Log/Channel/Module.pm
# once (14µs+4µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm
# once (14µs+3µs) by Mutex::Flock::BEGIN@80 at line 80 of Mutex/Flock.pm
# once (12µs+3µs) by Sys::Syslog::BEGIN@88 at line 88 of Sys/Syslog.pm | ||||
11 | 62 | 54µs | my $callpack = caller; | ||
12 | 62 | 138µs | my (undef, @imports) = @_; | ||
13 | 62 | 21µs | my ($sym, $ch); | ||
14 | 62 | 336µs | foreach (@imports) { | ||
15 | 184 | 1.45ms | 184 | 524µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 524µs making 184 calls to vars::CORE:match, avg 3µs/call |
16 | 184 | 434µs | 184 | 129µs | if ($sym =~ /\W/) { # spent 129µs making 184 calls to vars::CORE:match, avg 701ns/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 | 184 | 520µs | 184 | 104µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 104µs making 184 calls to vars::CORE:match, avg 567ns/call |
29 | *$sym = | ||||
30 | ( $ch eq "\$" ? \$$sym | ||||
31 | : $ch eq "\@" ? \@$sym | ||||
32 | : $ch eq "\%" ? \%$sym | ||||
33 | : $ch eq "\*" ? \*$sym | ||||
34 | : $ch eq "\&" ? \&$sym | ||||
35 | 184 | 910µ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 | 5µs | 1; | ||
47 | __END__ | ||||
sub vars::CORE:match; # opcode |