Filename | /usr/share/perl/5.14/vars.pm |
Statements | Executed 640 statements in 5.57ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
35 | 35 | 32 | 3.61ms | 4.60ms | import | vars::
369 | 3 | 1 | 994µs | 994µs | CORE:match (opcode) | vars::
1 | 1 | 1 | 289µs | 552µs | BEGIN@7 | vars::
1 | 1 | 1 | 56µs | 56µs | BEGIN@3 | vars::
1 | 1 | 1 | 14µs | 49µs | BEGIN@8 | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 2 | 112µs | 1 | 56µs | # spent 56µs within vars::BEGIN@3 which was called:
# once (56µs+0s) by File::Spec::BEGIN@4 at line 3 # spent 56µs making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 2µs | our $VERSION = '1.02'; | ||
6 | |||||
7 | 2 | 315µs | 2 | 815µs | # spent 552µs (289+263) within vars::BEGIN@7 which was called:
# once (289µs+263µs) by File::Spec::BEGIN@4 at line 7 # spent 552µs making 1 call to vars::BEGIN@7
# spent 263µs making 1 call to warnings::register::import |
8 | 2 | 421µs | 2 | 84µs | # spent 49µs (14+35) within vars::BEGIN@8 which was called:
# once (14µs+35µs) by File::Spec::BEGIN@4 at line 8 # spent 49µs making 1 call to vars::BEGIN@8
# spent 35µs making 1 call to strict::import |
9 | |||||
10 | # spent 4.60ms (3.61+994µs) within vars::import which was called 35 times, avg 131µs/call:
# once (234µs+59µs) by Foswiki::Plugins::SpreadSheetPlugin::BEGIN@11 at line 11 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/SpreadSheetPlugin.pm
# once (229µs+62µs) by Foswiki::Plugins::AutoViewTemplatePlugin::BEGIN@16 at line 16 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/AutoViewTemplatePlugin.pm
# once (205µs+57µs) by Foswiki::Plugins::TwistyPlugin::BEGIN@17 at line 17 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/TwistyPlugin.pm
# once (142µs+86µs) by Foswiki::Plugins::SmiliesPlugin::BEGIN@12 at line 12 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/SmiliesPlugin.pm
# once (154µs+42µs) by Foswiki::Plugins::RenderListPlugin::BEGIN@28 at line 28 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/RenderListPlugin.pm
# once (139µs+36µs) by Time::Local::BEGIN@8 at line 8 of Time/Local.pm
# once (136µs+35µs) by File::Temp::BEGIN@166 at line 166 of File/Temp.pm
# once (134µs+37µs) by Foswiki::Plugins::SlideShowPlugin::BEGIN@8 at line 8 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/SlideShowPlugin.pm
# once (132µs+37µs) by Digest::SHA::BEGIN@6 at line 6 of Digest/SHA.pm
# once (128µs+37µs) by CGI::Util::BEGIN@4 at line 4 of CGI/Util.pm
# once (126µs+35µs) by List::Util::BEGIN@12 at line 12 of List/Util.pm
# once (126µs+34µs) by URI::BEGIN@13 at line 13 of URI.pm
# once (114µs+32µs) by CGI::Session::Driver::file::BEGIN@11 at line 11 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Driver/file.pm
# once (113µs+31µs) by MIME::Base64::BEGIN@4 at line 4 of MIME/Base64.pm
# once (112µs+31µs) by Foswiki::Plugins::JQueryPlugin::BEGIN@17 at line 17 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/JQueryPlugin.pm
# once (112µs+30µs) by File::Path::BEGIN@19 at line 19 of File/Path.pm
# once (111µs+30µs) by Foswiki::Plugins::HistoryPlugin::BEGIN@12 at line 12 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/HistoryPlugin.pm
# once (107µs+29µs) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm
# once (101µs+28µs) by Cwd::BEGIN@172 at line 172 of Cwd.pm
# once (89µs+24µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm
# once (86µs+22µs) by Error::subs::BEGIN@295 at line 295 of Error.pm
# once (86µs+22µs) by Foswiki::Plugins::SubscribePlugin::BEGIN@7 at line 7 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/SubscribePlugin.pm
# once (84µs+22µs) by URI::BEGIN@7 at line 7 of URI.pm
# once (78µs+17µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm
# once (69µs+12µs) by URI::BEGIN@4 at line 4 of URI.pm
# once (63µs+16µs) by Foswiki::BEGIN@18 at line 18 of setlib.cfg
# once (59µs+15µs) by constant::BEGIN@6 at line 6 of constant.pm
# once (60µs+12µs) by Foswiki::Users::BEGIN@300 at line 300 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Users.pm
# once (46µs+9µs) by CGI::Session::Serialize::default::BEGIN@11 at line 11 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Serialize/default.pm
# once (41µs+10µs) by Error::BEGIN@15 at line 15 of Error.pm
# once (40µs+11µs) by base::BEGIN@4 at line 4 of base.pm
# once (40µs+10µs) by Foswiki::Plugins::PreferencesPlugin::BEGIN@33 at line 33 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins/PreferencesPlugin.pm
# once (38µs+8µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
# once (37µs+8µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm
# once (36µs+8µs) by Config::BEGIN@11 at line 11 of Config.pm | ||||
11 | 35 | 95µs | my $callpack = caller; | ||
12 | 35 | 127µs | my (undef, @imports) = @_; | ||
13 | 35 | 58µs | my ($sym, $ch); | ||
14 | 35 | 378µs | foreach (@imports) { | ||
15 | 123 | 1.70ms | 123 | 505µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 505µs making 123 calls to vars::CORE:match, avg 4µs/call |
16 | 123 | 751µs | 123 | 277µs | if ($sym =~ /\W/) { # spent 277µs making 123 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 | 123 | 757µs | 123 | 212µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 212µs making 123 calls to vars::CORE:match, avg 2µ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 | 123 | 847µ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 |