Filename | /usr/lib64/perl5/5.16.0/vars.pm |
Statements | Executed 996 statements in 22.7ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
61 | 61 | 41 | 15.0ms | 18.6ms | import | vars::
558 | 3 | 1 | 3.63ms | 3.63ms | CORE:match (opcode) | vars::
1 | 1 | 1 | 1.16ms | 1.87ms | BEGIN@7 | vars::
1 | 1 | 1 | 95µs | 95µs | BEGIN@3 | vars::
1 | 1 | 1 | 52µs | 133µs | BEGIN@8 | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 2 | 372µs | 1 | 95µs | # spent 95µs within vars::BEGIN@3 which was called:
# once (95µs+0s) by Cwd::BEGIN@172 at line 3 # spent 95µs making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 4µs | our $VERSION = '1.02'; | ||
6 | |||||
7 | 2 | 1.28ms | 2 | 2.57ms | # spent 1.87ms (1.16+708µs) within vars::BEGIN@7 which was called:
# once (1.16ms+708µs) by Cwd::BEGIN@172 at line 7 # spent 1.87ms making 1 call to vars::BEGIN@7
# spent 708µs making 1 call to warnings::register::import |
8 | 2 | 1.53ms | 2 | 215µs | # spent 133µs (52+82) within vars::BEGIN@8 which was called:
# once (52µs+82µs) by Cwd::BEGIN@172 at line 8 # spent 133µs making 1 call to vars::BEGIN@8
# spent 82µs making 1 call to strict::import |
9 | |||||
10 | # spent 18.6ms (15.0+3.63) within vars::import which was called 61 times, avg 305µs/call:
# once (967µs+256µs) by XML::LibXML::BEGIN@14 at line 14 of XML/LibXML.pm
# once (687µs+146µs) by Getopt::Long::BEGIN@45 at line 45 of Getopt/Long.pm
# once (530µs+137µs) by Pod::Escapes::BEGIN@23 at line 23 of Pod/Escapes.pm
# once (490µs+120µs) by Data::Dump::PHP::BEGIN@23 at line 23 of Data/Dump/PHP.pm
# once (468µs+121µs) by Pod::Select::BEGIN@13 at line 13 of Pod/Select.pm
# once (460µs+120µs) by Pod::Simple::BEGIN@13 at line 13 of Pod/Simple.pm
# once (437µs+97µs) by Getopt::Long::BEGIN@51 at line 51 of Getopt/Long.pm
# once (380µs+96µs) by Getopt::Long::BEGIN@48 at line 48 of Getopt/Long.pm
# once (377µs+94µs) by XML::LibXML::InputCallback::BEGIN@2076 at line 2076 of XML/LibXML.pm
# once (368µs+90µs) by File::Spec::Functions::BEGIN@6 at line 6 of File/Spec/Functions.pm
# once (359µs+89µs) by File::Temp::BEGIN@166 at line 166 of File/Temp.pm
# once (353µs+88µs) by Pod::Parser::BEGIN@14 at line 14 of Pod/Parser.pm
# once (346µs+91µs) by XML::Simple::BEGIN@49 at line 49 of XML/Simple.pm
# once (308µs+79µs) by XML::LibXML::BEGIN@36 at line 36 of XML/LibXML.pm
# once (313µs+74µs) by Cwd::BEGIN@172 at line 172 of Cwd.pm
# once (298µs+87µs) by Pod::Text::BEGIN@29 at line 29 of Pod/Text.pm
# once (308µs+75µs) by File::Which::BEGIN@8 at line 8 of File/Which.pm
# once (316µs+62µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm
# once (294µs+77µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm
# once (295µs+74µs) by Graphics::Magick::BEGIN@17 at line 17 of Graphics/Magick.pm
# once (289µs+72µs) by File::Path::BEGIN@19 at line 19 of File/Path.pm
# once (272µs+63µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm
# once (263µs+62µs) by MIME::Base64::BEGIN@4 at line 4 of MIME/Base64.pm
# once (254µs+60µs) by Data::Dump::PHP::BEGIN@6 at line 6 of Data/Dump/PHP.pm
# once (243µs+63µs) by XML::LibXML::XPathContext::BEGIN@13 at line 13 of XML/LibXML/XPathContext.pm
# once (239µs+63µs) by IO::WrapTie::BEGIN@9 at line 9 of IO/WrapTie.pm
# once (239µs+63µs) by Pod::Usage::BEGIN@13 at line 13 of Pod/Usage.pm
# once (237µs+62µs) by XML::SAX::BEGIN@6 at line 6 of XML/SAX.pm
# once (234µs+60µs) by XML::LibXML::Error::BEGIN@19 at line 19 of XML/LibXML/Error.pm
# once (224µs+54µs) by Getopt::Long::BEGIN@26 at line 26 of Getopt/Long.pm
# once (198µs+45µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm
# once (197µs+42µs) by IO::Scalar::BEGIN@151 at line 151 of IO/Scalar.pm
# once (188µs+45µs) by XML::LibXML::SAX::BEGIN@13 at line 13 of XML/LibXML/SAX.pm
# once (178µs+46µs) by constant::BEGIN@6 at line 6 of constant.pm
# once (180µs+44µs) by IO::AtomicFile::BEGIN@17 at line 17 of IO/AtomicFile.pm
# once (175µs+42µs) by IO::WrapTie::Master::BEGIN@35 at line 35 of IO/WrapTie.pm
# once (154µs+33µs) by XML::LibXML::Document::BEGIN@1366 at line 1366 of XML/LibXML.pm
# once (156µs+30µs) by XML::LibXML::Number::BEGIN@15 at line 15 of XML/LibXML/Number.pm
# once (153µs+31µs) by XML::LibXML::Text::BEGIN@1670 at line 1670 of XML/LibXML.pm
# once (132µs+31µs) by Pod::Simple::LinkSection::BEGIN@5 at line 5 of Pod/Simple/LinkSection.pm
# once (133µs+28µs) by Pod::InputObjects::BEGIN@14 at line 14 of Pod/InputObjects.pm
# once (132µs+28µs) by Pod::Simple::BlackBox::BEGIN@25 at line 25 of Pod/Simple/BlackBox.pm
# once (131µs+27µs) by XML::LibXML::DocumentFragment::BEGIN@1462 at line 1462 of XML/LibXML.pm
# once (126µs+30µs) by Pod::ParseTree::BEGIN@822 at line 822 of Pod/InputObjects.pm
# once (126µs+26µs) by XML::SAX::Exception::BEGIN@11 at line 11 of XML/SAX/Exception.pm
# once (126µs+24µs) by XML::LibXML::Comment::BEGIN@1715 at line 1715 of XML/LibXML.pm
# once (122µs+28µs) by Getopt::Long::BEGIN@19 at line 19 of Getopt/Long.pm
# once (117µs+30µs) by XML::LibXML::Literal::BEGIN@15 at line 15 of XML/LibXML/Literal.pm
# once (114µs+29µs) by Pod::Simple::LinkSection::BEGIN@10 at line 10 of Pod/Simple/LinkSection.pm
# once (114µs+28µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm
# once (111µs+29µs) by base::BEGIN@4 at line 4 of base.pm
# once (111µs+29µs) by XML::LibXML::Boolean::BEGIN@16 at line 16 of XML/LibXML/Boolean.pm
# once (112µs+28µs) by XML::SAX::ParserFactory::BEGIN@6 at line 6 of XML/SAX/ParserFactory.pm
# once (113µs+26µs) by XML::LibXML::NodeList::BEGIN@19 at line 19 of XML/LibXML/NodeList.pm
# once (112µs+27µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
# once (113µs+23µs) by XML::LibXML::Element::BEGIN@1485 at line 1485 of XML/LibXML.pm
# once (110µs+20µs) by XML::LibXML::Dtd::BEGIN@1753 at line 1753 of XML/LibXML.pm
# once (102µs+28µs) by Config::BEGIN@11 at line 11 of Config.pm
# once (104µs+20µs) by XML::LibXML::CDATASection::BEGIN@1722 at line 1722 of XML/LibXML.pm
# once (104µs+19µs) by XML::LibXML::Attr::BEGIN@1731 at line 1731 of XML/LibXML.pm
# once (103µs+19µs) by XML::LibXML::PI::BEGIN@1764 at line 1764 of XML/LibXML.pm | ||||
11 | 61 | 359µs | my $callpack = caller; | ||
12 | 61 | 691µs | my (undef, @imports) = @_; | ||
13 | 61 | 140µs | my ($sym, $ch); | ||
14 | 61 | 1.95ms | foreach (@imports) { | ||
15 | 186 | 7.11ms | 186 | 2.54ms | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 2.54ms making 186 calls to vars::CORE:match, avg 14µs/call |
16 | 186 | 2.40ms | 186 | 556µs | if ($sym =~ /\W/) { # spent 556µs making 186 calls to vars::CORE:match, avg 3µ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 | } | ||||
28 | 186 | 2.83ms | 186 | 529µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 529µs making 186 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 | 186 | 3.99ms | : 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 | 12µs | 1; | ||
47 | __END__ | ||||
sub vars::CORE:match; # opcode |