Filename | /home/s1/perl5/perlbrew/perls/perl-5.22.1/lib/5.22.1/strict.pm |
Statements | Executed 432 statements in 1.11ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
29 | 2 | 1 | 194µs | 194µs | bits | strict::
27 | 27 | 13 | 180µs | 348µs | unimport | strict::
49 | 49 | 45 | 154µs | 180µs | import | strict::
1 | 1 | 1 | 38µs | 38µs | BEGIN@14 | strict::
1 | 1 | 1 | 28µs | 28µs | CORE:regcomp (opcode) | strict::
1 | 1 | 1 | 7µs | 7µs | CORE:match (opcode) | strict::
0 | 0 | 0 | 0s | 0s | __ANON__[:31] | strict::
0 | 0 | 0 | 0s | 0s | __ANON__[:37] | strict::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package strict; | ||||
2 | |||||
3 | 1 | 600ns | $strict::VERSION = "1.09"; | ||
4 | |||||
5 | # Verify that we're called correctly so that strictures will work. | ||||
6 | 1 | 48µs | 2 | 35µs | unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { # spent 28µs making 1 call to strict::CORE:regcomp
# spent 7µ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 | 300ns | my ( %bitmask, %explicit_bitmask ); | ||
13 | |||||
14 | # spent 38µs within strict::BEGIN@14 which was called:
# once (38µs+0s) by DateTime::Format::Alami::EN::BEGIN@7 at line 38 | ||||
15 | 1 | 2µs | %bitmask = ( | ||
16 | refs => 0x00000002, | ||||
17 | subs => 0x00000200, | ||||
18 | vars => 0x00000400, | ||||
19 | ); | ||||
20 | |||||
21 | 1 | 1µs | %explicit_bitmask = ( | ||
22 | refs => 0x00000020, | ||||
23 | subs => 0x00000040, | ||||
24 | vars => 0x00000080, | ||||
25 | ); | ||||
26 | |||||
27 | 1 | 300ns | my $bits = 0; | ||
28 | 1 | 5µs | $bits |= $_ for values %bitmask; | ||
29 | |||||
30 | 1 | 200ns | my $inline_all_bits = $bits; | ||
31 | 1 | 9µs | *all_bits = sub () { $inline_all_bits }; | ||
32 | |||||
33 | 1 | 100ns | $bits = 0; | ||
34 | 1 | 2µs | $bits |= $_ for values %explicit_bitmask; | ||
35 | |||||
36 | 1 | 100ns | my $inline_all_explicit_bits = $bits; | ||
37 | 1 | 10µs | *all_explicit_bits = sub () { $inline_all_explicit_bits }; | ||
38 | 1 | 243µs | 1 | 38µs | } # spent 38µs making 1 call to strict::BEGIN@14 |
39 | |||||
40 | sub bits { | ||||
41 | 29 | 12µs | my $bits = 0; | ||
42 | 29 | 7µs | my @wrong; | ||
43 | 29 | 29µs | foreach my $s (@_) { | ||
44 | 31 | 36µs | if (exists $bitmask{$s}) { | ||
45 | 31 | 42µs | $^H |= $explicit_bitmask{$s}; | ||
46 | |||||
47 | 31 | 14µs | $bits |= $bitmask{$s}; | ||
48 | } | ||||
49 | else { | ||||
50 | push @wrong, $s; | ||||
51 | } | ||||
52 | } | ||||
53 | 29 | 19µs | if (@wrong) { | ||
54 | require Carp; | ||||
55 | Carp::croak("Unknown 'strict' tag(s) '@wrong'"); | ||||
56 | } | ||||
57 | 29 | 124µs | $bits; | ||
58 | } | ||||
59 | |||||
60 | # spent 180µs (154+26) within strict::import which was called 49 times, avg 4µs/call:
# once (7µs+13µs) by Class::Inspector::BEGIN@45 at line 45 of Class/Inspector.pm
# once (6µs+6µs) by vars::BEGIN@8 at line 8 of vars.pm
# once (5µs+7µs) by base::BEGIN@4 at line 4 of base.pm
# once (8µs+0s) by Role::Tiny::With::BEGIN@3 at line 3 of Role/Tiny/With.pm
# once (5µs+0s) by DateTime::Locale::FromData::BEGIN@3 at line 3 of DateTime/Locale/FromData.pm
# once (5µs+0s) by Role::Tiny::BEGIN@6 at line 6 of Role/Tiny.pm
# once (5µs+0s) by Parse::Number::EN::BEGIN@9 at line 9 of Parse/Number/EN.pm
# once (4µs+0s) by DateTime::Format::Alami::EN::BEGIN@7 at line 7 of lib/DateTime/Format/Alami/EN.pm
# once (4µs+0s) by Carp::BEGIN@4 at line 4 of Carp.pm
# once (4µs+0s) by DateTime::Format::Alami::BEGIN@7 at line 7 of lib/DateTime/Format/Alami.pm
# once (4µs+0s) by Data::Graph::Util::BEGIN@7 at line 7 of Data/Graph/Util.pm
# once (4µs+0s) by List::Util::BEGIN@9 at line 9 of List/Util.pm
# once (3µs+0s) by Try::Tiny::BEGIN@7 at line 7 of Try/Tiny.pm
# once (3µs+0s) by version::regex::BEGIN@3 at line 3 of version/regex.pm
# once (3µs+0s) by DateTime::Duration::BEGIN@3 at line 3 of DateTime/Duration.pm
# once (3µs+0s) by DateTime::Infinite::BEGIN@3 at line 3 of DateTime/Infinite.pm
# once (3µs+0s) by DateTime::BEGIN@5 at line 5 of DateTime.pm
# once (3µs+0s) by DateTime::Locale::Data::BEGIN@17 at line 17 of DateTime/Locale/Data.pm
# once (3µs+0s) by Sub::Util::BEGIN@7 at line 7 of Sub/Util.pm
# once (3µs+0s) by Class::Singleton::BEGIN@19 at line 19 of Class/Singleton.pm
# once (3µs+0s) by Params::Validate::BEGIN@5 at line 5 of Params/Validate.pm
# once (3µs+0s) by experimental::BEGIN@3 at line 3 of experimental.pm
# once (3µs+0s) by DateTime::Helpers::BEGIN@3 at line 3 of DateTime/Helpers.pm
# once (3µs+0s) by re::BEGIN@4 at line 4 of re.pm
# once (3µs+0s) by version::BEGIN@5 at line 5 of version.pm
# once (2µs+0s) by DateTime::Infinite::Future::BEGIN@72 at line 72 of DateTime/Infinite.pm
# once (2µs+0s) by Params::Validate::XS::BEGIN@3 at line 3 of Params/Validate/XS.pm
# once (2µs+0s) by constant::BEGIN@3 at line 3 of constant.pm
# once (2µs+0s) by DateTime::TimeZone::Floating::BEGIN@3 at line 3 of DateTime/TimeZone/Floating.pm
# once (2µs+0s) by File::Spec::BEGIN@3 at line 3 of File/Spec.pm
# once (2µs+0s) by DateTime::TimeZone::OlsonDB::Change::BEGIN@3 at line 3 of DateTime/TimeZone/OlsonDB/Change.pm
# once (2µs+0s) by Role::Tiny::import at line 53 of Role/Tiny.pm
# once (2µs+0s) by Module::Implementation::BEGIN@5 at line 5 of Module/Implementation.pm
# once (2µs+0s) by DateTime::TimeZone::BEGIN@5 at line 5 of DateTime/TimeZone.pm
# once (2µs+0s) by Fcntl::BEGIN@58 at line 58 of Fcntl.pm
# once (2µs+0s) by DateTime::Locale::BEGIN@5 at line 5 of DateTime/Locale.pm
# once (2µs+0s) by Params::Validate::Constants::BEGIN@3 at line 3 of Params/Validate/Constants.pm
# once (2µs+0s) by File::Spec::Unix::BEGIN@3 at line 3 of File/Spec/Unix.pm
# once (2µs+0s) by POSIX::BEGIN@2 at line 2 of POSIX.pm
# once (2µs+0s) by DateTime::TimeZone::OffsetOnly::BEGIN@3 at line 3 of DateTime/TimeZone/OffsetOnly.pm
# once (2µs+0s) by version::vxs::BEGIN@5 at line 5 of version/vxs.pm
# once (2µs+0s) by Scalar::Util::BEGIN@9 at line 9 of Scalar/Util.pm
# once (2µs+0s) by DateTime::TimeZone::Local::BEGIN@3 at line 3 of DateTime/TimeZone/Local.pm
# once (2µs+0s) by DateTime::TimeZone::Catalog::BEGIN@10 at line 10 of DateTime/TimeZone/Catalog.pm
# once (2µs+0s) by DateTime::Locale::Util::BEGIN@3 at line 3 of DateTime/Locale/Util.pm
# once (2µs+0s) by parent::BEGIN@2 at line 2 of parent.pm
# once (2µs+0s) by DateTime::TimeZone::UTC::BEGIN@3 at line 3 of DateTime/TimeZone/UTC.pm
# once (2µs+0s) by FakeLocale::BEGIN@123 at line 123 of DateTime/Infinite.pm
# once (2µs+0s) by DateTime::Infinite::Past::BEGIN@97 at line 97 of DateTime/Infinite.pm | ||||
61 | 49 | 12µs | shift; | ||
62 | 49 | 321µs | 3 | 26µs | $^H |= @_ ? &bits : all_bits | all_explicit_bits; # spent 26µs making 3 calls to strict::bits, avg 9µs/call |
63 | } | ||||
64 | |||||
65 | # spent 348µs (180+168) within strict::unimport which was called 27 times, avg 13µs/call:
# once (16µs+19µs) by Role::Tiny::BEGIN@303 at line 303 of Role/Tiny.pm
# once (11µs+10µs) by DateTime::Format::Alami::BEGIN@497 at line 497 of lib/DateTime/Format/Alami.pm
# once (11µs+8µs) by Carp::BEGIN@132 at line 132 of Carp.pm
# once (9µs+8µs) by DateTime::Infinite::BEGIN@14 at line 14 of DateTime/Infinite.pm
# once (8µs+7µs) by constant::BEGIN@40 at line 40 of constant.pm
# once (7µs+7µs) by DateTime::Locale::FromData::BEGIN@70 at line 70 of DateTime/Locale/FromData.pm
# once (7µs+8µs) by Class::Inspector::BEGIN@540 at line 540 of Class/Inspector.pm
# once (7µs+6µs) by Carp::BEGIN@590 at line 590 of Carp.pm
# once (6µs+6µs) by List::Util::BEGIN@31 at line 31 of List/Util.pm
# once (6µs+6µs) by DateTime::Format::Alami::BEGIN@247 at line 247 of lib/DateTime/Format/Alami.pm
# once (6µs+6µs) by DateTime::Format::Alami::BEGIN@50 at line 50 of lib/DateTime/Format/Alami.pm
# once (6µs+6µs) by Module::Implementation::BEGIN@128 at line 128 of Module/Implementation.pm
# once (6µs+5µs) by DateTime::Format::Alami::BEGIN@160 at line 160 of lib/DateTime/Format/Alami.pm
# once (6µs+6µs) by File::Spec::Unix::BEGIN@182 at line 182 of File/Spec/Unix.pm
# once (6µs+5µs) by Class::Inspector::BEGIN@553 at line 553 of Class/Inspector.pm
# once (6µs+5µs) by version::BEGIN@33 at line 33 of version.pm
# once (5µs+5µs) by parent::BEGIN@21 at line 21 of parent.pm
# once (6µs+5µs) by constant::BEGIN@90 at line 90 of constant.pm
# once (6µs+5µs) by constant::BEGIN@141 at line 141 of constant.pm
# once (5µs+5µs) by constant::BEGIN@65 at line 65 of constant.pm
# once (5µs+5µs) by Carp::BEGIN@610 at line 610 of Carp.pm
# once (5µs+5µs) by DateTime::Format::Alami::BEGIN@504 at line 504 of lib/DateTime/Format/Alami.pm
# once (5µs+5µs) by version::BEGIN@52 at line 52 of version.pm
# once (5µs+5µs) by version::BEGIN@70 at line 70 of version.pm
# once (5µs+5µs) by FakeLocale::BEGIN@166 at line 166 of DateTime/Infinite.pm
# once (4µs+4µs) by DateTime::Locale::FromData::BEGIN@89 at line 89 of DateTime/Locale/FromData.pm
# once (4µs+0s) by POSIX::BEGIN@206 at line 206 of POSIX.pm | ||||
66 | 27 | 6µs | shift; | ||
67 | |||||
68 | 27 | 112µs | if (@_) { | ||
69 | 26 | 45µs | 26 | 168µs | $^H &= ~&bits; # spent 168µs making 26 calls to strict::bits, avg 6µs/call |
70 | } | ||||
71 | else { | ||||
72 | 1 | 1µs | $^H &= ~all_bits; | ||
73 | 1 | 800ns | $^H |= all_explicit_bits; | ||
74 | } | ||||
75 | } | ||||
76 | |||||
77 | 1 | 9µs | 1; | ||
78 | __END__ | ||||
# spent 7µs within strict::CORE:match which was called:
# once (7µs+0s) by DateTime::Format::Alami::EN::BEGIN@7 at line 6 | |||||
# spent 28µs within strict::CORE:regcomp which was called:
# once (28µs+0s) by DateTime::Format::Alami::EN::BEGIN@7 at line 6 |