Filename | /usr/lib/perl5/5.20.1/strict.pm |
Statements | Executed 635 statements in 452µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
47 | 2 | 1 | 210µs | 210µs | bits | strict::
32 | 32 | 27 | 98µs | 254µs | import | strict::
15 | 15 | 9 | 50µs | 105µs | unimport | strict::
1 | 1 | 1 | 12µs | 12µs | CORE:regcomp (opcode) | strict::
1 | 1 | 1 | 2µs | 2µs | CORE:match (opcode) | strict::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package strict; | ||||
2 | |||||
3 | 1 | 200ns | $strict::VERSION = "1.08"; | ||
4 | |||||
5 | # Verify that we're called correctly so that strictures will work. | ||||
6 | 1 | 20µs | 2 | 14µs | unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { # spent 12µs making 1 call to strict::CORE:regcomp
# spent 2µ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 | 1µs | my %bitmask = ( | ||
13 | refs => 0x00000002, | ||||
14 | subs => 0x00000200, | ||||
15 | vars => 0x00000400 | ||||
16 | ); | ||||
17 | 1 | 500ns | my %explicit_bitmask = ( | ||
18 | refs => 0x00000020, | ||||
19 | subs => 0x00000040, | ||||
20 | vars => 0x00000080 | ||||
21 | ); | ||||
22 | |||||
23 | sub bits { | ||||
24 | 47 | 11µs | my $bits = 0; | ||
25 | 47 | 5µs | my @wrong; | ||
26 | 47 | 28µs | foreach my $s (@_) { | ||
27 | 100 | 30µs | if (exists $bitmask{$s}) { | ||
28 | 100 | 46µs | $^H |= $explicit_bitmask{$s}; | ||
29 | } | ||||
30 | else { push @wrong, $s }; | ||||
31 | 100 | 48µs | $bits |= $bitmask{$s} || 0; | ||
32 | } | ||||
33 | 47 | 10µs | if (@wrong) { | ||
34 | require Carp; | ||||
35 | Carp::croak("Unknown 'strict' tag(s) '@wrong'"); | ||||
36 | } | ||||
37 | 47 | 90µs | $bits; | ||
38 | } | ||||
39 | |||||
40 | 1 | 500ns | my @default_bits = qw(refs subs vars); | ||
41 | |||||
42 | # spent 254µs (98+155) within strict::import which was called 32 times, avg 8µs/call:
# once (12µs+9µs) by Exporter::Heavy::BEGIN@3 at line 3 of Exporter/Heavy.pm
# once (5µs+9µs) by Date::Manip::TZ::amnew_00::BEGIN@17 at line 17 of Date/Manip/TZ/amnew_00.pm
# once (5µs+7µs) by Date::Manip::Obj::BEGIN@11 at line 11 of Date/Manip/Obj.pm
# once (4µs+8µs) by Date::Manip::Delta::BEGIN@19 at line 19 of Date/Manip/Delta.pm
# once (4µs+6µs) by Date::Manip::Lang::english::BEGIN@11 at line 11 of Date/Manip/Lang/english.pm
# once (4µs+6µs) by main::BEGIN@8 at line 8 of ../dm5dm6_ex3
# once (3µs+5µs) by Date::Manip::Date::BEGIN@1 at line 1 of Tie/Hash/NamedCapture.pm
# once (3µs+5µs) by Config::BEGIN@9 at line 9 of Config.pm
# once (3µs+5µs) by Date::Manip::Zones::BEGIN@16 at line 16 of Date/Manip/Zones.pm
# once (3µs+5µs) by Date::Manip::Lang::index::BEGIN@24 at line 24 of Date/Manip/Lang/index.pm
# once (3µs+5µs) by Encode::Config::BEGIN@7 at line 7 of Encode/Config.pm
# once (3µs+5µs) by Encode::Alias::BEGIN@2 at line 2 of Encode/Alias.pm
# once (3µs+5µs) by Fcntl::BEGIN@58 at line 58 of Fcntl.pm
# once (3µs+4µs) by Time::HiRes::BEGIN@4 at line 4 of Time/HiRes.pm
# once (2µs+5µs) by IO::Handle::BEGIN@264 at line 264 of IO/Handle.pm
# once (3µs+5µs) by Encode::Encoding::BEGIN@4 at line 4 of Encode/Encoding.pm
# once (3µs+4µs) by IO::File::BEGIN@128 at line 128 of IO/File.pm
# once (2µs+4µs) by Carp::BEGIN@4 at line 4 of Carp.pm
# once (2µs+4µs) by Date::Manip::Date::BEGIN@19 at line 19 of Date/Manip/Date.pm
# once (2µs+5µs) by IO::Seekable::BEGIN@99 at line 99 of IO/Seekable.pm
# once (2µs+4µs) by Encode::BEGIN@5 at line 5 of Encode.pm
# once (2µs+5µs) by Date::Manip::TZ_Base::BEGIN@11 at line 11 of Date/Manip/TZ_Base.pm
# once (2µs+4µs) by constant::BEGIN@3 at line 3 of constant.pm
# once (2µs+4µs) by vars::BEGIN@8 at line 8 of vars.pm
# once (2µs+4µs) by Date::Manip::TZ::BEGIN@20 at line 20 of Date/Manip/TZ.pm
# once (2µs+3µs) by Date::Manip::Base::BEGIN@1409 at line 1409 of Date/Manip/Base.pm
# once (2µs+4µs) by IO::BEGIN@7 at line 7 of IO.pm
# once (2µs+3µs) by Date::Manip::TZ::BEGIN@189 at line 189 of Date/Manip/TZ.pm
# once (2µs+3µs) by Date::Manip::Base::BEGIN@19 at line 19 of Date/Manip/Base.pm
# once (2µs+2µs) by Date::Manip::TZ_Base::BEGIN@403 at line 403 of Date/Manip/TZ_Base.pm
# once (2µs+2µs) by Date::Manip::TZ::BEGIN@1586 at line 1586 of Date/Manip/TZ.pm
# once (2µs+2µs) by Date::Manip::Base::BEGIN@1474 at line 1474 of Date/Manip/Base.pm | ||||
43 | 32 | 5µs | shift; | ||
44 | 32 | 101µs | 32 | 155µs | $^H |= bits(@_ ? @_ : @default_bits); # spent 155µs making 32 calls to strict::bits, avg 5µs/call |
45 | } | ||||
46 | |||||
47 | # spent 105µs (50+55) within strict::unimport which was called 15 times, avg 7µs/call:
# once (6µs+4µs) by IO::Handle::BEGIN@631 at line 631 of IO/Handle.pm
# once (5µs+4µs) by Carp::BEGIN@131 at line 131 of Carp.pm
# once (4µs+5µs) by Date::Manip::Base::BEGIN@1339 at line 1339 of Date/Manip/Base.pm
# once (4µs+4µs) by Date::Manip::TZ_Base::BEGIN@399 at line 399 of Date/Manip/TZ_Base.pm
# once (3µs+4µs) by Carp::BEGIN@555 at line 555 of Carp.pm
# once (3µs+4µs) by Date::Manip::TZ::BEGIN@1582 at line 1582 of Date/Manip/TZ.pm
# once (4µs+3µs) by Time::HiRes::BEGIN@43 at line 43 of Time/HiRes.pm
# once (3µs+4µs) by constant::BEGIN@39 at line 39 of constant.pm
# once (3µs+4µs) by Date::Manip::TZ::BEGIN@158 at line 158 of Date/Manip/TZ.pm
# once (3µs+3µs) by constant::BEGIN@126 at line 126 of constant.pm
# once (3µs+3µs) by Config::BEGIN@47 at line 47 of Config.pm
# once (2µs+4µs) by constant::BEGIN@64 at line 64 of constant.pm
# once (3µs+3µs) by Date::Manip::Base::BEGIN@1470 at line 1470 of Date/Manip/Base.pm
# once (2µs+3µs) by Exporter::Heavy::BEGIN@4 at line 4 of Exporter/Heavy.pm
# once (2µs+3µs) by Carp::BEGIN@575 at line 575 of Carp.pm | ||||
48 | 15 | 2µs | shift; | ||
49 | 15 | 48µs | 15 | 55µs | $^H &= ~ bits(@_ ? @_ : @default_bits); # spent 55µs making 15 calls to strict::bits, avg 4µs/call |
50 | } | ||||
51 | |||||
52 | 1 | 6µs | 1; | ||
53 | __END__ | ||||
# spent 2µs within strict::CORE:match which was called:
# once (2µs+0s) by main::BEGIN@8 at line 6 | |||||
# spent 12µs within strict::CORE:regcomp which was called:
# once (12µs+0s) by main::BEGIN@8 at line 6 |