Filename | /usr/share/perl/5.10/vars.pm |
Statements | Executed 423 statements in 3.30ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
34 | 34 | 19 | 1.90ms | 2.35ms | import | vars::
207 | 3 | 1 | 446µs | 446µs | CORE:match (opcode) | vars::
1 | 1 | 1 | 358µs | 526µs | BEGIN@7 | vars::
1 | 1 | 1 | 56µs | 56µs | BEGIN@3 | vars::
1 | 1 | 1 | 12µs | 38µs | BEGIN@8 | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 3 | 92µs | 1 | 56µs | # spent 56µs within vars::BEGIN@3 which was called:
# once (56µs+0s) by MARC::File::XML::BEGIN@5 at line 3 # spent 56µs making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 1µs | our $VERSION = '1.01'; | ||
6 | |||||
7 | 3 | 383µs | 2 | 694µs | # spent 526µs (358+168) within vars::BEGIN@7 which was called:
# once (358µs+168µs) by MARC::File::XML::BEGIN@5 at line 7 # spent 526µs making 1 call to vars::BEGIN@7
# spent 168µs making 1 call to warnings::register::import |
8 | 3 | 379µs | 2 | 64µs | # spent 38µs (12+26) within vars::BEGIN@8 which was called:
# once (12µs+26µs) by MARC::File::XML::BEGIN@5 at line 8 # spent 38µs making 1 call to vars::BEGIN@8
# spent 26µs making 1 call to strict::import |
9 | |||||
10 | # spent 2.35ms (1.90+446µs) within vars::import which was called 34 times, avg 69µs/call:
# once (300µs+87µs) by XML::LibXML::BEGIN@14 at line 14 of XML/LibXML.pm
# once (121µs+26µs) by POSIX::SigRt::BEGIN@66 at line 66 of POSIX.pm
# once (92µs+22µs) by XML::LibXML::Error::BEGIN@12 at line 12 of XML/LibXML/Error.pm
# once (85µs+27µs) by XML::LibXML::BEGIN@35 at line 35 of XML/LibXML.pm
# once (86µs+18µs) by XML::LibXML::XPathContext::BEGIN@13 at line 13 of XML/LibXML/XPathContext.pm
# once (83µs+19µs) by XML::LibXML::InputCallback::BEGIN@2077 at line 2077 of XML/LibXML.pm
# once (80µs+17µs) by MARC::Record::BEGIN@27 at line 27 of MARC/Record.pm
# once (71µs+23µs) by Storable::BEGIN@24 at line 24 of Storable.pm
# once (68µs+12µs) by MARC::File::XML::BEGIN@5 at line 5 of lib/MARC/File/XML.pm
# once (57µs+14µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm
# once (51µs+15µs) by constant::BEGIN@6 at line 6 of constant.pm
# once (50µs+12µs) by XML::SAX::Exception::BEGIN@8 at line 8 of XML/SAX/Exception.pm
# once (43µs+10µs) by XML::LibXML::Document::BEGIN@1359 at line 1359 of XML/LibXML.pm
# once (43µs+6µs) by XML::LibXML::Dtd::BEGIN@1754 at line 1754 of XML/LibXML.pm
# once (38µs+7µs) by XML::LibXML::Text::BEGIN@1663 at line 1663 of XML/LibXML.pm
# once (37µs+8µs) by MARC::File::USMARC::BEGIN@12 at line 12 of MARC/File/USMARC.pm
# once (36µs+8µs) by XML::LibXML::DocumentFragment::BEGIN@1455 at line 1455 of XML/LibXML.pm
# once (36µs+7µs) by XML::LibXML::Element::BEGIN@1478 at line 1478 of XML/LibXML.pm
# once (34µs+8µs) by XML::LibXML::PI::BEGIN@1765 at line 1765 of XML/LibXML.pm
# once (35µs+7µs) by XML::LibXML::Literal::BEGIN@15 at line 15 of XML/LibXML/Literal.pm
# once (35µs+7µs) by MARC::Record::BEGIN@12 at line 12 of MARC/Record.pm
# once (36µs+6µs) by MARC::File::USMARC::BEGIN@16 at line 16 of MARC/File/USMARC.pm
# once (34µs+7µs) by XML::LibXML::Comment::BEGIN@1716 at line 1716 of XML/LibXML.pm
# once (34µs+7µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
# once (34µs+7µs) by XML::LibXML::Number::BEGIN@15 at line 15 of XML/LibXML/Number.pm
# once (33µs+7µs) by XML::LibXML::Attr::BEGIN@1732 at line 1732 of XML/LibXML.pm
# once (33µs+7µs) by XML::LibXML::NodeList::BEGIN@16 at line 16 of XML/LibXML/NodeList.pm
# once (32µs+7µs) by XML::LibXML::Boolean::BEGIN@16 at line 16 of XML/LibXML/Boolean.pm
# once (33µs+6µs) by MARC::File::BEGIN@12 at line 12 of MARC/File.pm
# once (30µs+7µs) by base::BEGIN@4 at line 4 of base.pm
# once (32µs+5µs) by XML::LibXML::CDATASection::BEGIN@1723 at line 1723 of XML/LibXML.pm
# once (30µs+7µs) by MARC::Record::BEGIN@32 at line 32 of MARC/Record.pm
# once (29µs+7µs) by MARC::Field::BEGIN@10 at line 10 of MARC/Field.pm
# once (30µs+6µs) by MARC::Record::BEGIN@23 at line 23 of MARC/Record.pm | ||||
11 | 34 | 56µs | my $callpack = caller; | ||
12 | 34 | 88µs | my ($pack, @imports) = @_; | ||
13 | 34 | 41µs | my ($sym, $ch); | ||
14 | 34 | 259µs | foreach (@imports) { | ||
15 | 69 | 862µs | 69 | 244µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 244µs making 69 calls to vars::CORE:match, avg 4µs/call |
16 | 69 | 342µs | 69 | 110µs | if ($sym =~ /\W/) { # spent 110µs making 69 calls to vars::CORE:match, avg 2µ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 | 69 | 357µs | 69 | 92µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 92µs making 69 calls to vars::CORE:match, avg 1µ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 | 69 | 431µ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 | 4µs | 1; | ||
47 | __END__ | ||||
sub vars::CORE:match; # opcode |