Filename | /usr/lib/x86_64-linux-gnu/perl-base/vars.pm |
Statements | Executed 764 statements in 1.29ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
33 | 33 | 22 | 702µs | 855µs | import | vars::
468 | 3 | 1 | 153µs | 153µs | CORE:match (opcode) | vars::
1 | 1 | 1 | 139µs | 158µs | BEGIN@7 | vars::
1 | 1 | 1 | 10µs | 10µs | BEGIN@3 | vars::
1 | 1 | 1 | 4µs | 8µs | BEGIN@8 | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 2 | 37µs | 1 | 10µs | # spent 10µs within vars::BEGIN@3 which was called:
# once (10µs+0s) by Carp::Assert::BEGIN@8 at line 3 # spent 10µs making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 200ns | our $VERSION = '1.05'; | ||
6 | |||||
7 | 2 | 152µs | 2 | 177µs | # spent 158µs (139+19) within vars::BEGIN@7 which was called:
# once (139µs+19µs) by Carp::Assert::BEGIN@8 at line 7 # spent 158µs making 1 call to vars::BEGIN@7
# spent 19µs making 1 call to warnings::register::import |
8 | 2 | 211µs | 2 | 11µs | # spent 8µs (4+3) within vars::BEGIN@8 which was called:
# once (4µs+3µs) by Carp::Assert::BEGIN@8 at line 8 # spent 8µs making 1 call to vars::BEGIN@8
# spent 3µs making 1 call to strict::import |
9 | |||||
10 | # spent 855µs (702+153) within vars::import which was called 33 times, avg 26µs/call:
# once (52µs+11µs) by DynaLoader::BEGIN@27 at line 27 of DynaLoader.pm
# once (49µs+10µs) by Params::Check::BEGIN@10 at line 10 of Params/Check.pm
# once (47µs+9µs) by Pod::Escapes::BEGIN@6 at line 6 of Pod/Escapes.pm
# once (44µs+6µs) by IPC::Cmd::BEGIN@16 at line 16 of IPC/Cmd.pm
# once (40µs+8µs) by Module::Load::Conditional::BEGIN@21 at line 21 of Module/Load/Conditional.pm
# once (32µs+6µs) by ExtUtils::MakeMaker::version::BEGIN@17 at line 17 of ExtUtils/MakeMaker/version.pm
# once (30µs+7µs) by IPC::Run::BEGIN@1016 at line 1016 of IPC/Run.pm
# once (31µs+6µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm
# once (25µs+6µs) by Pod::Simple::BEGIN@14 at line 14 of Pod/Simple.pm
# once (25µs+6µs) by IPC::Run::BEGIN@3688 at line 3689 of IPC/Run.pm
# once (23µs+5µs) by IPC::Run::Debug::BEGIN@72 at line 72 of IPC/Run/Debug.pm
# once (22µs+6µs) by File::Path::BEGIN@20 at line 20 of File/Path.pm
# once (21µs+5µs) by Pod::Text::BEGIN@21 at line 21 of Pod/Text.pm
# once (22µs+4µs) by Getopt::Long::BEGIN@49 at line 49 of Getopt/Long.pm
# once (21µs+5µs) by Text::CSV::BEGIN@7 at line 7 of Text/CSV.pm
# once (19µs+5µs) by Carp::Assert::BEGIN@8 at line 8 of Carp/Assert.pm
# once (18µs+4µs) by Text::CSV_XS::BEGIN@28 at line 28 of Text/CSV_XS.pm
# once (18µs+3µs) by Getopt::Long::BEGIN@52 at line 52 of Getopt/Long.pm
# once (17µs+4µs) by IPC::Run::Timer::BEGIN@167 at line 167 of IPC/Run/Timer.pm
# once (13µs+4µs) by IPC::Run::IO::BEGIN@482 at line 483 of IPC/Run/IO.pm
# once (13µs+3µs) by Getopt::Long::BEGIN@27 at line 27 of Getopt/Long.pm
# once (12µs+4µs) by Pod::Simple::BlackBox::BEGIN@24 at line 24 of Pod/Simple/BlackBox.pm
# once (13µs+2µs) by Getopt::Long::BEGIN@47 at line 47 of Getopt/Long.pm
# once (13µs+3µs) by Pod::Simple::LinkSection::BEGIN@8 at line 8 of Pod/Simple/LinkSection.pm
# once (11µs+3µs) by IPC::Run::IO::BEGIN@74 at line 74 of IPC/Run/IO.pm
# once (11µs+4µs) by Getopt::Long::BEGIN@20 at line 20 of Getopt/Long.pm
# once (11µs+3µs) by IPC::Run::BEGIN@1515 at line 1515 of IPC/Run.pm
# once (10µs+3µs) by IPC::Run::BEGIN@1086 at line 1086 of IPC/Run.pm
# once (11µs+2µs) by ExtUtils::MM_Unix::BEGIN@17 at line 17 of ExtUtils/MM_Unix.pm
# once (8µs+2µs) by Pod::Simple::TiedOutFH::BEGIN@6 at line 6 of Pod/Simple/TiedOutFH.pm
# once (8µs+2µs) by IPC::Run::Debug::BEGIN@25 at line 25 of (eval 24)[IPC/Run/Debug.pm:103]
# once (7µs+2µs) by IPC::Run::BEGIN@1123 at line 1123 of IPC/Run.pm
# once (6µs+1µs) by Getopt::Long::BEGIN@23 at line 23 of Getopt/Long.pm | ||||
11 | 33 | 17µs | my $callpack = caller; | ||
12 | 33 | 29µs | my (undef, @imports) = @_; | ||
13 | 33 | 7µs | my ($sym, $ch); | ||
14 | 33 | 76µs | foreach (@imports) { | ||
15 | 156 | 280µs | 156 | 104µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 104µs making 156 calls to vars::CORE:match, avg 667ns/call |
16 | 156 | 109µs | 156 | 24µs | if ($sym =~ /\W/) { # spent 24µs making 156 calls to vars::CORE:match, avg 154ns/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 | 156 | 132µs | 156 | 25µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 25µs making 156 calls to vars::CORE:match, avg 160ns/call |
29 | *$sym = | ||||
30 | ( $ch eq "\$" ? \$$sym | ||||
31 | : $ch eq "\@" ? \@$sym | ||||
32 | : $ch eq "\%" ? \%$sym | ||||
33 | : $ch eq "\*" ? \*$sym | ||||
34 | : $ch eq "\&" ? \&$sym | ||||
35 | 156 | 237µ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 |