| Filename | /usr/libdata/perl5/strict.pm |
| Statements | Executed 227 statements in 826µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 15 | 2 | 1 | 163µs | 163µs | strict::bits |
| 1 | 1 | 1 | 142µs | 157µs | strict::BEGIN@7 |
| 14 | 14 | 7 | 130µs | 274µs | strict::unimport |
| 24 | 24 | 24 | 110µs | 129µs | strict::import |
| 1 | 1 | 1 | 15µs | 15µs | strict::CORE:match (opcode) |
| 0 | 0 | 0 | 0s | 0s | strict::__ANON__[:31] |
| 0 | 0 | 0 | 0s | 0s | strict::__ANON__[:37] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package strict; | ||||
| 2 | |||||
| 3 | 1 | 900ns | $strict::VERSION = "1.11"; | ||
| 4 | |||||
| 5 | 1 | 600ns | my ( %bitmask, %explicit_bitmask ); | ||
| 6 | |||||
| 7 | # spent 157µs (142+15) within strict::BEGIN@7 which was called:
# once (142µs+15µs) by main::BEGIN@19 at line 38 | ||||
| 8 | # Verify that we're called correctly so that strictures will work. | ||||
| 9 | # Can't use Carp, since Carp uses us! | ||||
| 10 | # see also warnings.pm. | ||||
| 11 | 1 | 76µs | 1 | 15µs | die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2] # spent 15µs making 1 call to strict::CORE:match |
| 12 | if __FILE__ !~ ( '(?x) \b '.__PACKAGE__.' \.pmc? \z' ) | ||||
| 13 | && __FILE__ =~ ( '(?x) \b (?i:'.__PACKAGE__.') \.pmc? \z' ); | ||||
| 14 | |||||
| 15 | 1 | 3µ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 | 800ns | my $bits = 0; | ||
| 28 | 1 | 16µs | $bits |= $_ for values %bitmask; | ||
| 29 | |||||
| 30 | 1 | 600ns | my $inline_all_bits = $bits; | ||
| 31 | 1 | 32µs | *all_bits = sub () { $inline_all_bits }; | ||
| 32 | |||||
| 33 | 1 | 700ns | $bits = 0; | ||
| 34 | 1 | 4µs | $bits |= $_ for values %explicit_bitmask; | ||
| 35 | |||||
| 36 | 1 | 700ns | my $inline_all_explicit_bits = $bits; | ||
| 37 | 1 | 8µs | *all_explicit_bits = sub () { $inline_all_explicit_bits }; | ||
| 38 | 1 | 178µs | 1 | 157µs | } # spent 157µs making 1 call to strict::BEGIN@7 |
| 39 | |||||
| 40 | sub bits { | ||||
| 41 | 15 | 12µs | my $bits = 0; | ||
| 42 | 15 | 10µs | my @wrong; | ||
| 43 | 15 | 25µs | foreach my $s (@_) { | ||
| 44 | 16 | 36µs | if (exists $bitmask{$s}) { | ||
| 45 | 16 | 22µs | $^H |= $explicit_bitmask{$s}; | ||
| 46 | |||||
| 47 | 16 | 13µs | $bits |= $bitmask{$s}; | ||
| 48 | } | ||||
| 49 | else { | ||||
| 50 | push @wrong, $s; | ||||
| 51 | } | ||||
| 52 | } | ||||
| 53 | 15 | 12µs | if (@wrong) { | ||
| 54 | require Carp; | ||||
| 55 | Carp::croak("Unknown 'strict' tag(s) '@wrong'"); | ||||
| 56 | } | ||||
| 57 | 15 | 67µs | $bits; | ||
| 58 | } | ||||
| 59 | |||||
| 60 | # spent 129µs (110+19) within strict::import which was called 24 times, avg 5µs/call:
# once (8µs+19µs) by vars::BEGIN@8 at line 8 of vars.pm
# once (12µs+0s) by main::BEGIN@19 at line 19 of /usr/sbin/pkg_info
# once (10µs+0s) by File::Spec::BEGIN@3 at line 3 of File/Spec.pm
# once (5µs+0s) by OpenBSD::PackageLocator::BEGIN@18.13 at line 18 of OpenBSD/PackageRepository/Installed.pm
# once (4µs+0s) by Exporter::Heavy::BEGIN@3 at line 3 of Exporter/Heavy.pm
# once (4µs+0s) by OpenBSD::State::BEGIN@18 at line 18 of OpenBSD/Subst.pm
# once (4µs+0s) by OpenBSD::PackageInfo::BEGIN@18.6 at line 18 of OpenBSD/Paths.pm
# once (4µs+0s) by OpenBSD::PackageRepository::BEGIN@18 at line 18 of OpenBSD/PackageLocation.pm
# once (4µs+0s) by OpenBSD::State::BEGIN@18.8 at line 18 of OpenBSD/PackageLocator.pm
# once (4µs+0s) by OpenBSD::State::BEGIN@17 at line 17 of OpenBSD/Error.pm
# once (4µs+0s) by OpenBSD::PkgInfo::BEGIN@21 at line 21 of OpenBSD/Getopt.pm
# once (4µs+0s) by main::BEGIN@19.1 at line 19 of OpenBSD/PkgInfo.pm
# once (4µs+0s) by OpenBSD::PkgInfo::State::BEGIN@18 at line 18 of OpenBSD/PackageInfo.pm
# once (4µs+0s) by Carp::BEGIN@4 at line 4 of Carp.pm
# once (4µs+0s) by OpenBSD::PackageLocator::BEGIN@18.10 at line 18 of OpenBSD/PackageRepository.pm
# once (4µs+0s) by OpenBSD::PkgInfo::BEGIN@18 at line 18 of OpenBSD/Search.pm
# once (4µs+0s) by Fcntl::BEGIN@58 at line 58 of Fcntl.pm
# once (4µs+0s) by OpenBSD::PackageLocator::BEGIN@18 at line 18 of OpenBSD/PackageRepositoryList.pm
# once (4µs+0s) by OpenBSD::PackageInfo::BEGIN@18 at line 18 of OpenBSD/PackageName.pm
# once (4µs+0s) by OpenBSD::PackageLocation::BEGIN@18 at line 18 of OpenBSD/Temp.pm
# once (4µs+0s) by File::Spec::Unix::BEGIN@3 at line 3 of File/Spec/Unix.pm
# once (4µs+0s) by constant::BEGIN@3 at line 3 of constant.pm
# once (4µs+0s) by OpenBSD::MkTemp::BEGIN@4 at line 4 of OpenBSD/MkTemp.pm
# once (3µs+0s) by main::BEGIN@19.3 at line 19 of OpenBSD/State.pm | ||||
| 61 | 24 | 16µs | shift; | ||
| 62 | 24 | 164µs | 1 | 19µs | $^H |= @_ ? &bits : all_bits | all_explicit_bits; # spent 19µs making 1 call to strict::bits |
| 63 | } | ||||
| 64 | |||||
| 65 | # spent 274µs (130+144) within strict::unimport which was called 14 times, avg 20µs/call:
# once (16µs+11µs) by Carp::BEGIN@132 at line 132 of Carp.pm
# once (16µs+10µs) by constant::BEGIN@90 at line 90 of constant.pm
# once (11µs+10µs) by File::Spec::Unix::BEGIN@182 at line 182 of File/Spec/Unix.pm
# once (9µs+11µs) by Carp::BEGIN@592 at line 592 of Carp.pm
# once (9µs+11µs) by OpenBSD::State::BEGIN@300 at line 300 of OpenBSD/State.pm
# once (8µs+11µs) by constant::BEGIN@40 at line 40 of constant.pm
# once (8µs+11µs) by OpenBSD::Getopt::BEGIN@37 at line 37 of OpenBSD/Getopt.pm
# once (8µs+11µs) by OpenBSD::Auto::BEGIN@29 at line 29 of OpenBSD/Error.pm
# once (7µs+11µs) by Exporter::Heavy::BEGIN@4 at line 4 of Exporter/Heavy.pm
# once (8µs+10µs) by Carp::BEGIN@612 at line 612 of Carp.pm
# once (7µs+10µs) by constant::BEGIN@65 at line 65 of constant.pm
# once (7µs+9µs) by constant::BEGIN@141 at line 141 of constant.pm
# once (7µs+9µs) by OpenBSD::Getopt::BEGIN@38 at line 38 of OpenBSD/Getopt.pm
# once (7µs+9µs) by OpenBSD::State::BEGIN@301 at line 301 of OpenBSD/State.pm | ||||
| 66 | 14 | 9µs | shift; | ||
| 67 | |||||
| 68 | 14 | 64µs | if (@_) { | ||
| 69 | 14 | 49µs | 14 | 144µs | $^H &= ~&bits; # spent 144µs making 14 calls to strict::bits, avg 10µs/call |
| 70 | } | ||||
| 71 | else { | ||||
| 72 | $^H &= ~all_bits; | ||||
| 73 | $^H |= all_explicit_bits; | ||||
| 74 | } | ||||
| 75 | } | ||||
| 76 | |||||
| 77 | 1 | 4µs | 1; | ||
| 78 | __END__ | ||||
# spent 15µs within strict::CORE:match which was called:
# once (15µs+0s) by strict::BEGIN@7 at line 11 |