Filename | /usr/share/perl/5.18/strict.pm |
Statements | Executed 1059 statements in 1.59ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
75 | 2 | 1 | 802µs | 802µs | bits | strict::
52 | 41 | 39 | 349µs | 957µs | import | strict::
23 | 23 | 15 | 167µs | 362µs | unimport | strict::
1 | 1 | 1 | 22µs | 22µs | CORE:regcomp (opcode) | strict::
1 | 1 | 1 | 6µs | 6µs | CORE:match (opcode) | strict::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package strict; | ||||
2 | |||||
3 | 1 | 900ns | $strict::VERSION = "1.07"; | ||
4 | |||||
5 | # Verify that we're called correctly so that strictures will work. | ||||
6 | 1 | 55µs | 2 | 29µs | unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { # spent 22µs making 1 call to strict::CORE:regcomp
# spent 6µs making 1 call to strict::CORE:match |
7 | # Can't use Carp, since Carp uses us! | ||||
8 | my (undef, $f, $l) = caller; | ||||
9 | die("Incorrect use of pragma '${\__PACKAGE__}' at $f line $l.\n"); | ||||
10 | } | ||||
11 | |||||
12 | 1 | 3µs | my %bitmask = ( | ||
13 | refs => 0x00000002, | ||||
14 | subs => 0x00000200, | ||||
15 | vars => 0x00000400 | ||||
16 | ); | ||||
17 | 1 | 900ns | my %explicit_bitmask = ( | ||
18 | refs => 0x00000020, | ||||
19 | subs => 0x00000040, | ||||
20 | vars => 0x00000080 | ||||
21 | ); | ||||
22 | |||||
23 | sub bits { | ||||
24 | 75 | 37µs | my $bits = 0; | ||
25 | 75 | 18µs | my @wrong; | ||
26 | 75 | 121µs | foreach my $s (@_) { | ||
27 | 176 | 127µs | if (exists $bitmask{$s}) { | ||
28 | 176 | 178µs | $^H |= $explicit_bitmask{$s}; | ||
29 | } | ||||
30 | else { push @wrong, $s }; | ||||
31 | 176 | 167µs | $bits |= $bitmask{$s} || 0; | ||
32 | } | ||||
33 | 75 | 32µs | if (@wrong) { | ||
34 | require Carp; | ||||
35 | Carp::croak("Unknown 'strict' tag(s) '@wrong'"); | ||||
36 | } | ||||
37 | 75 | 352µs | $bits; | ||
38 | } | ||||
39 | |||||
40 | 1 | 1µs | my @default_bits = qw(refs subs vars); | ||
41 | |||||
42 | # spent 957µs (349+608) within strict::import which was called 52 times, avg 18µs/call:
# 11 times (68µs+121µs) by Moo::_strictures::import at line 13 of Moo/_strictures.pm, avg 17µs/call
# 2 times (10µs+19µs) by Moo::import at line 25 of Moo.pm, avg 14µs/call
# once (7µs+29µs) by Sub::Exporter::BEGIN@1 at line 1 of Data/OptList.pm
# once (7µs+28µs) by Sub::Name::BEGIN@53 at line 53 of Sub/Name.pm
# once (8µs+25µs) by List::Util::BEGIN@9 at line 9 of List/Util.pm
# once (9µs+16µs) by main::BEGIN@2 at line 2 of index.cgi
# once (13µs+11µs) by Sub::Util::BEGIN@7 at line 7 of Sub/Util.pm
# once (9µs+14µs) by Data::UUID::BEGIN@3 at line 3 of Data/UUID.pm
# once (11µs+11µs) by constant::BEGIN@3 at line 3 of constant.pm
# once (9µs+11µs) by Moo::_strictures::BEGIN@2 at line 2 of Moo/_strictures.pm
# once (7µs+12µs) by Data::GUID::BEGIN@2.3 at line 2 of Sub/Exporter.pm
# once (7µs+11µs) by Moo::BEGIN@1 at line 1 of Class/Method/Modifiers.pm
# once (7µs+11µs) by Sub::Identify::BEGIN@3 at line 3 of Sub/Identify.pm
# once (7µs+11µs) by Package::Stash::XS::BEGIN@8 at line 8 of Package/Stash/XS.pm
# once (7µs+11µs) by Devel::GlobalDestruction::BEGIN@3 at line 3 of Devel/GlobalDestruction.pm
# once (7µs+11µs) by B::Hooks::EndOfScope::XS::BEGIN@4 at line 4 of B/Hooks/EndOfScope/XS.pm
# once (7µs+10µs) by Digest::base::BEGIN@3 at line 3 of Digest/base.pm
# once (7µs+11µs) by B::BEGIN@9 at line 9 of B.pm
# once (6µs+11µs) by Class::XSAccessor::BEGIN@3 at line 3 of Class/XSAccessor.pm
# once (7µs+11µs) by Digest::MD5::BEGIN@3 at line 3 of Digest/MD5.pm
# once (7µs+11µs) by Sub::Exporter::Progressive::BEGIN@3 at line 3 of Sub/Exporter/Progressive.pm
# once (6µs+11µs) by Config::BEGIN@9 at line 9 of Config.pm
# once (6µs+11µs) by String::Markov::BEGIN@1 at line 1 of namespace/autoclean.pm
# once (6µs+11µs) by Params::Util::BEGIN@59 at line 59 of Params/Util.pm
# once (6µs+11µs) by Unicode::Normalize::BEGIN@10 at line 10 of Unicode/Normalize.pm
# once (6µs+11µs) by Variable::Magic::BEGIN@5 at line 5 of Variable/Magic.pm
# once (6µs+11µs) by Data::GUID::BEGIN@1 at line 1 of Sub/Install.pm
# once (6µs+11µs) by Class::XSAccessor::Heavy::BEGIN@5 at line 5 of Class/XSAccessor/Heavy.pm
# once (6µs+10µs) by Module::Implementation::BEGIN@5 at line 5 of Module/Implementation.pm
# once (6µs+10µs) by Carp::BEGIN@4 at line 4 of Carp.pm
# once (6µs+10µs) by mro::BEGIN@10 at line 10 of mro.pm
# once (6µs+10µs) by main::BEGIN@1 at line 1 of Data/GUID.pm
# once (6µs+10µs) by Package::Stash::BEGIN@6 at line 6 of Package/Stash.pm
# once (6µs+10µs) by namespace::clean::BEGIN@4 at line 4 of namespace/clean.pm
# once (6µs+10µs) by B::Hooks::EndOfScope::BEGIN@5 at line 5 of B/Hooks/EndOfScope.pm
# once (6µs+10µs) by Scalar::Util::BEGIN@9 at line 9 of Scalar/Util.pm
# once (7µs+9µs) by base::BEGIN@3 at line 3 of base.pm
# once (6µs+10µs) by Try::Tiny::BEGIN@9 at line 9 of Try/Tiny.pm
# once (6µs+10µs) by namespace::clean::_Util::BEGIN@13 at line 13 of namespace/clean/_Util.pm
# once (6µs+9µs) by vars::BEGIN@8 at line 8 of vars.pm
# once (6µs+9µs) by Sub::Exporter::Progressive::BEGIN@23 at line 23 of Sub/Exporter/Progressive.pm | ||||
43 | 52 | 17µs | shift; | ||
44 | 52 | 317µs | 52 | 608µs | $^H |= bits(@_ ? @_ : @default_bits); # spent 608µs making 52 calls to strict::bits, avg 12µs/call |
45 | } | ||||
46 | |||||
47 | # spent 362µs (167+195) within strict::unimport which was called 23 times, avg 16µs/call:
# once (8µs+14µs) by B::BEGIN@251 at line 251 of B.pm
# once (7µs+12µs) by Config::BEGIN@47 at line 47 of Config.pm
# once (9µs+9µs) by Carp::BEGIN@433 at line 433 of Carp.pm
# once (8µs+9µs) by Sub::Quote::BEGIN@162 at line 162 of Sub/Quote.pm
# once (8µs+9µs) by Data::GUID::BEGIN@116 at line 116 of Data/GUID.pm
# once (8µs+9µs) by namespace::autoclean::BEGIN@203 at line 203 of namespace/autoclean.pm
# once (8µs+9µs) by Module::Implementation::BEGIN@128 at line 128 of Module/Implementation.pm
# once (8µs+8µs) by Class::Method::Modifiers::BEGIN@200 at line 200 of Class/Method/Modifiers.pm
# once (7µs+8µs) by Sub::Install::BEGIN@170 at line 170 of Sub/Install.pm
# once (8µs+8µs) by Class::Method::Modifiers::BEGIN@58 at line 58 of Class/Method/Modifiers.pm
# once (7µs+8µs) by Moo::BEGIN@76 at line 76 of Moo.pm
# once (7µs+8µs) by constant::BEGIN@28 at line 28 of constant.pm
# once (7µs+8µs) by Carp::BEGIN@67 at line 67 of Carp.pm
# once (7µs+8µs) by Moo::_Utils::BEGIN@120 at line 120 of Moo/_Utils.pm
# once (7µs+8µs) by Class::XSAccessor::Heavy::BEGIN@27 at line 27 of Class/XSAccessor/Heavy.pm
# once (8µs+7µs) by List::Util::BEGIN@31 at line 31 of List/Util.pm
# once (7µs+7µs) by constant::BEGIN@116 at line 116 of constant.pm
# once (7µs+7µs) by Class::Method::Modifiers::BEGIN@149 at line 149 of Class/Method/Modifiers.pm
# once (7µs+7µs) by Carp::BEGIN@448 at line 448 of Carp.pm
# once (6µs+8µs) by constant::BEGIN@54 at line 54 of constant.pm
# once (6µs+7µs) by Sub::Exporter::Progressive::BEGIN@18 at line 18 of Sub/Exporter/Progressive.pm
# once (6µs+7µs) by Carp::BEGIN@18 at line 18 of Carp.pm
# once (6µs+7µs) by Carp::BEGIN@8 at line 8 of Carp.pm | ||||
48 | 23 | 7µs | shift; | ||
49 | 23 | 146µs | 23 | 195µs | $^H &= ~ bits(@_ ? @_ : @default_bits); # spent 195µs making 23 calls to strict::bits, avg 8µs/call |
50 | } | ||||
51 | |||||
52 | 1 | 12µs | 1; | ||
53 | __END__ | ||||
# spent 6µs within strict::CORE:match which was called:
# once (6µs+0s) by main::BEGIN@2 at line 6 | |||||
# spent 22µs within strict::CORE:regcomp which was called:
# once (22µs+0s) by main::BEGIN@2 at line 6 |