Filename | /usr/lib/perl5/5.12.4/strict.pm |
Statements | Executed 259 statements in 3.94ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
20 | 3 | 1 | 1.01ms | 1.01ms | bits | strict::
36 | 36 | 36 | 1.01ms | 1.13ms | import | strict::
18 | 18 | 11 | 828µs | 1.63ms | unimport | strict::
1 | 1 | 1 | 78µs | 78µs | CORE:regcomp (opcode) | strict::
1 | 1 | 1 | 48µs | 48µs | CORE:match (opcode) | strict::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package strict; | ||||
2 | |||||
3 | 1 | 6µs | $strict::VERSION = "1.04"; | ||
4 | |||||
5 | # Verify that we're called correctly so that strictures will work. | ||||
6 | 1 | 207µs | 2 | 126µs | unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { # spent 78µs making 1 call to strict::CORE:regcomp
# spent 48µ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 | 17µs | my %bitmask = ( | ||
13 | refs => 0x00000002, | ||||
14 | subs => 0x00000200, | ||||
15 | vars => 0x00000400 | ||||
16 | ); | ||||
17 | |||||
18 | sub bits { | ||||
19 | 100 | 823µs | my $bits = 0; | ||
20 | my @wrong; | ||||
21 | foreach my $s (@_) { | ||||
22 | 46 | 337µs | push @wrong, $s unless exists $bitmask{$s}; | ||
23 | $bits |= $bitmask{$s} || 0; | ||||
24 | } | ||||
25 | if (@wrong) { | ||||
26 | require Carp; | ||||
27 | Carp::croak("Unknown 'strict' tag(s) '@wrong'"); | ||||
28 | } | ||||
29 | $bits; | ||||
30 | } | ||||
31 | |||||
32 | 1 | 22µs | 1 | 83µs | my $default_bits = bits(qw(refs subs vars)); # spent 83µs making 1 call to strict::bits |
33 | |||||
34 | # spent 1.13ms (1.01+122µs) within strict::import which was called 36 times, avg 31µs/call:
# once (46µs+75µs) by vars::BEGIN@8 at line 8 of vars.pm
# once (45µs+47µs) by base::BEGIN@3 at line 3 of base.pm
# once (40µs+0s) by DateTime::TimeZone::Catalog::BEGIN@10 at line 10 of DateTime/TimeZone/Catalog.pm
# once (36µs+0s) by DateTime::TimeZone::BEGIN@5 at line 5 of DateTime/TimeZone.pm
# once (35µs+0s) by DateTime::BEGIN@8 at line 8 of DateTime.pm
# once (35µs+0s) by DateTime::TimeZone::Floating::BEGIN@3 at line 3 of DateTime/TimeZone/Floating.pm
# once (29µs+0s) by DateTime::Locale::root::BEGIN@21 at line 21 of DateTime/Locale/root.pm
# once (29µs+0s) by AutoLoader::BEGIN@3 at line 3 of AutoLoader.pm
# once (28µs+0s) by DateTime::Infinite::BEGIN@6 at line 6 of DateTime/Infinite.pm
# once (28µs+0s) by DateTime::Locale::Catalog::BEGIN@17 at line 17 of DateTime/Locale/Catalog.pm
# once (28µs+0s) by Math::Round::BEGIN@3 at line 3 of Math/Round.pm
# once (27µs+0s) by Exporter::Heavy::BEGIN@3 at line 3 of Exporter/Heavy.pm
# once (26µs+0s) by DateTime::Locale::BEGIN@3 at line 3 of DateTime/Locale.pm
# once (26µs+0s) by List::Util::BEGIN@11 at line 11 of List/Util.pm
# once (26µs+0s) by Params::Validate::BEGIN@8 at line 8 of Params/Validate.pm
# once (26µs+0s) by Params::Validate::XS::BEGIN@3 at line 3 of Params/Validate/XS.pm
# once (26µs+0s) by DateTime::TimeZone::Local::BEGIN@3 at line 3 of DateTime/TimeZone/Local.pm
# once (26µs+0s) by DateTime::Locale::en_US::BEGIN@21 at line 21 of DateTime/Locale/en_US.pm
# once (26µs+0s) by Try::Tiny::BEGIN@3 at line 3 of Try/Tiny.pm
# once (26µs+0s) by constant::BEGIN@3 at line 3 of constant.pm
# once (26µs+0s) by DateTime::TimeZone::UTC::BEGIN@3 at line 3 of DateTime/TimeZone/UTC.pm
# once (26µs+0s) by DateTime::Duration::BEGIN@6 at line 6 of DateTime/Duration.pm
# once (25µs+0s) by DateTime::TimeZone::OffsetOnly::BEGIN@3 at line 3 of DateTime/TimeZone/OffsetOnly.pm
# once (25µs+0s) by Fcntl::BEGIN@58 at line 58 of Fcntl.pm
# once (25µs+0s) by Params::Validate::Constants::BEGIN@3 at line 3 of Params/Validate/Constants.pm
# once (25µs+0s) by POSIX::BEGIN@2 at line 2 of POSIX.pm
# once (25µs+0s) by Config::BEGIN@5 at line 5 of Config_heavy.pl
# once (25µs+0s) by File::Spec::Unix::BEGIN@3 at line 3 of File/Spec/Unix.pm
# once (25µs+0s) by DateTime::Locale::en::BEGIN@21 at line 21 of DateTime/Locale/en.pm
# once (24µs+0s) by Module::Implementation::BEGIN@6 at line 6 of Module/Implementation.pm
# once (24µs+0s) by DateTime::Locale::Base::BEGIN@3 at line 3 of DateTime/Locale/Base.pm
# once (24µs+0s) by Config::BEGIN@9 at line 9 of Config.pm
# once (24µs+0s) by File::Spec::BEGIN@3 at line 3 of File/Spec.pm
# once (24µs+0s) by DateTime::Helpers::BEGIN@6 at line 6 of DateTime/Helpers.pm
# once (24µs+0s) by List::MoreUtils::BEGIN@4 at line 4 of List/MoreUtils.pm
# once (23µs+0s) by Scalar::Util::BEGIN@9 at line 9 of Scalar/Util.pm | ||||
35 | 72 | 1.60ms | shift; | ||
36 | 2 | 122µs | $^H |= @_ ? bits(@_) : $default_bits; # spent 122µs making 2 calls to strict::bits, avg 61µs/call | ||
37 | } | ||||
38 | |||||
39 | # spent 1.63ms (828µs+801µs) within strict::unimport which was called 18 times, avg 91µs/call:
# once (66µs+48µs) by Carp::BEGIN@303 at line 303 of Carp.pm
# once (46µs+64µs) by DateTime::Locale::Base::BEGIN@25 at line 25 of DateTime/Locale/Base.pm
# once (50µs+53µs) by Fcntl::BEGIN@239 at line 239 of Fcntl.pm
# once (50µs+48µs) by DateTime::Locale::Base::BEGIN@363 at line 363 of DateTime/Locale/Base.pm
# once (50µs+47µs) by Module::Implementation::BEGIN@113 at line 113 of Module/Implementation.pm
# once (48µs+47µs) by File::Spec::Unix::BEGIN@149 at line 149 of File/Spec/Unix.pm
# once (49µs+46µs) by AutoLoader::BEGIN@138 at line 138 of AutoLoader.pm
# once (47µs+45µs) by DateTime::Locale::Base::BEGIN@176 at line 176 of DateTime/Locale/Base.pm
# once (40µs+51µs) by Exporter::Heavy::BEGIN@4 at line 4 of Exporter/Heavy.pm
# once (43µs+47µs) by Config::BEGIN@35 at line 35 of Config.pm
# once (47µs+43µs) by DateTime::Locale::Base::BEGIN@119 at line 119 of DateTime/Locale/Base.pm
# once (44µs+46µs) by AutoLoader::BEGIN@30 at line 30 of AutoLoader.pm
# once (45µs+45µs) by constant::BEGIN@29 at line 29 of constant.pm
# once (44µs+43µs) by AutoLoader::BEGIN@186 at line 186 of AutoLoader.pm
# once (46µs+41µs) by constant::BEGIN@52 at line 52 of constant.pm
# once (43µs+43µs) by constant::BEGIN@114 at line 114 of constant.pm
# once (42µs+43µs) by DateTime::Infinite::BEGIN@15 at line 15 of DateTime/Infinite.pm
# once (28µs+0s) by POSIX::BEGIN@39 at line 39 of POSIX.pm | ||||
40 | 36 | 881µs | shift; | ||
41 | 17 | 801µs | $^H &= ~ (@_ ? bits(@_) : $default_bits); # spent 801µs making 17 calls to strict::bits, avg 47µs/call | ||
42 | } | ||||
43 | |||||
44 | 1 | 46µs | 1; | ||
45 | __END__ | ||||
# spent 48µs within strict::CORE:match which was called:
# once (48µs+0s) by DateTime::BEGIN@8 at line 6 | |||||
# spent 78µs within strict::CORE:regcomp which was called:
# once (78µs+0s) by DateTime::BEGIN@8 at line 6 |