| Filename | /usr/libdata/perl5/strict.pm |
| Statements | Executed 330 statements in 2.14ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 20 | 2 | 1 | 726µs | 726µs | strict::bits |
| 46 | 46 | 45 | 284µs | 303µs | strict::import |
| 20 | 20 | 13 | 253µs | 961µs | strict::unimport |
| 1 | 1 | 1 | 236µs | 264µs | strict::BEGIN@7 |
| 1 | 1 | 1 | 27µs | 27µ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 | 1µs | $strict::VERSION = "1.11"; | ||
| 4 | |||||
| 5 | 1 | 1µs | my ( %bitmask, %explicit_bitmask ); | ||
| 6 | |||||
| 7 | # spent 264µs (236+27) within strict::BEGIN@7 which was called:
# once (236µs+27µ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 | 123µs | 1 | 27µs | die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2] # spent 27µ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 | 5µs | %bitmask = ( | ||
| 16 | refs => 0x00000002, | ||||
| 17 | subs => 0x00000200, | ||||
| 18 | vars => 0x00000400, | ||||
| 19 | ); | ||||
| 20 | |||||
| 21 | 1 | 2µs | %explicit_bitmask = ( | ||
| 22 | refs => 0x00000020, | ||||
| 23 | subs => 0x00000040, | ||||
| 24 | vars => 0x00000080, | ||||
| 25 | ); | ||||
| 26 | |||||
| 27 | 1 | 900ns | my $bits = 0; | ||
| 28 | 1 | 31µs | $bits |= $_ for values %bitmask; | ||
| 29 | |||||
| 30 | 1 | 900ns | my $inline_all_bits = $bits; | ||
| 31 | 1 | 54µs | *all_bits = sub () { $inline_all_bits }; | ||
| 32 | |||||
| 33 | 1 | 900ns | $bits = 0; | ||
| 34 | 1 | 6µs | $bits |= $_ for values %explicit_bitmask; | ||
| 35 | |||||
| 36 | 1 | 1µs | my $inline_all_explicit_bits = $bits; | ||
| 37 | 1 | 15µs | *all_explicit_bits = sub () { $inline_all_explicit_bits }; | ||
| 38 | 1 | 323µs | 1 | 264µs | } # spent 264µs making 1 call to strict::BEGIN@7 |
| 39 | |||||
| 40 | sub bits { | ||||
| 41 | 20 | 21µs | my $bits = 0; | ||
| 42 | 20 | 16µs | my @wrong; | ||
| 43 | 20 | 51µs | foreach my $s (@_) { | ||
| 44 | 21 | 57µs | if (exists $bitmask{$s}) { | ||
| 45 | 21 | 44µs | $^H |= $explicit_bitmask{$s}; | ||
| 46 | |||||
| 47 | 21 | 21µs | $bits |= $bitmask{$s}; | ||
| 48 | } | ||||
| 49 | else { | ||||
| 50 | push @wrong, $s; | ||||
| 51 | } | ||||
| 52 | } | ||||
| 53 | 20 | 21µs | if (@wrong) { | ||
| 54 | require Carp; | ||||
| 55 | Carp::croak("Unknown 'strict' tag(s) '@wrong'"); | ||||
| 56 | } | ||||
| 57 | 20 | 131µs | $bits; | ||
| 58 | } | ||||
| 59 | |||||
| 60 | # spent 303µs (284+18) within strict::import which was called 46 times, avg 7µs/call:
# once (44µs+0s) by IO::Uncompress::Gunzip::BEGIN@8 at line 8 of IO/Uncompress/Gunzip.pm
# once (8µs+18µs) by vars::BEGIN@8 at line 8 of vars.pm
# once (22µs+0s) by main::BEGIN@19 at line 19 of /usr/sbin/pkg_info
# once (9µs+0s) by File::Spec::BEGIN@3 at line 3 of File/Spec.pm
# once (8µs+0s) by IO::Compress::Base::Common::BEGIN@3 at line 3 of IO/Compress/Base/Common.pm
# once (8µs+0s) by OpenBSD::State::BEGIN@18 at line 18 of OpenBSD/Subst.pm
# once (8µs+0s) by main::BEGIN@19.1 at line 19 of OpenBSD/PkgInfo.pm
# once (8µs+0s) by OpenBSD::State::BEGIN@17 at line 17 of OpenBSD/Error.pm
# once (7µs+0s) by Carp::BEGIN@4 at line 4 of Carp.pm
# once (7µs+0s) by main::BEGIN@19.3 at line 19 of OpenBSD/State.pm
# once (6µs+0s) by IO::Uncompress::RawInflate::BEGIN@4 at line 4 of IO/Uncompress/RawInflate.pm
# once (6µs+0s) by List::Util::BEGIN@9 at line 9 of List/Util.pm
# once (6µs+0s) by Scalar::Util::BEGIN@9 at line 9 of Scalar/Util.pm
# once (6µs+0s) by Compress::Raw::Zlib::BEGIN@8 at line 8 of Compress/Raw/Zlib.pm
# once (6µs+0s) by IO::Compress::Base::Common::BEGIN@520 at line 520 of IO/Compress/Base/Common.pm
# once (6µs+0s) by OpenBSD::PackageLocation::BEGIN@20 at line 20 of OpenBSD/Ustar.pm
# once (6µs+0s) by File::Glob::BEGIN@3 at line 3 of File/Glob.pm
# once (6µs+0s) by File::GlobMapper::BEGIN@3 at line 3 of File/GlobMapper.pm
# once (5µs+0s) by File::Path::BEGIN@4 at line 4 of File/Path.pm
# once (5µs+0s) by IO::Uncompress::Base::BEGIN@4 at line 4 of IO/Uncompress/Base.pm
# once (5µs+0s) by OpenBSD::PkgInfo::State::BEGIN@18 at line 18 of OpenBSD/PackageInfo.pm
# once (5µs+0s) by IO::Compress::Zlib::Extra::BEGIN@5 at line 5 of IO/Compress/Zlib/Extra.pm
# once (4µs+0s) by IO::File::BEGIN@128 at line 128 of IO/File.pm
# once (4µs+0s) by IO::Seekable::BEGIN@99 at line 99 of IO/Seekable.pm
# once (4µs+0s) by OpenBSD::PackageLocator::BEGIN@18.10 at line 18 of OpenBSD/PackageRepository.pm
# once (4µs+0s) by Fcntl::BEGIN@58 at line 58 of Fcntl.pm
# once (4µs+0s) by OpenBSD::PackageRepository::BEGIN@18 at line 18 of OpenBSD/PackageLocation.pm
# once (4µs+0s) by OpenBSD::PackageInfo::BEGIN@18.6 at line 18 of OpenBSD/Paths.pm
# once (4µs+0s) by OpenBSD::PackageLocation::BEGIN@18 at line 18 of OpenBSD/Temp.pm
# once (4µs+0s) by IO::Uncompress::Adapter::Inflate::BEGIN@3 at line 3 of IO/Uncompress/Adapter/Inflate.pm
# once (4µs+0s) by IO::Handle::BEGIN@264 at line 264 of IO/Handle.pm
# once (4µs+0s) by OpenBSD::PkgInfo::BEGIN@21 at line 21 of OpenBSD/Getopt.pm
# once (4µs+0s) by OpenBSD::PkgInfo::BEGIN@18 at line 18 of OpenBSD/Search.pm
# once (4µs+0s) by OpenBSD::Ustar::BEGIN@17 at line 17 of OpenBSD/IdCache.pm
# once (4µs+0s) by OpenBSD::PackageLocator::BEGIN@18.13 at line 18 of OpenBSD/PackageRepository/Installed.pm
# once (4µs+0s) by OpenBSD::PackageInfo::BEGIN@18 at line 18 of OpenBSD/PackageName.pm
# once (4µs+0s) by OpenBSD::State::BEGIN@18.8 at line 18 of OpenBSD/PackageLocator.pm
# once (4µs+0s) by OpenBSD::MkTemp::BEGIN@4 at line 4 of OpenBSD/MkTemp.pm
# once (4µs+0s) by Exporter::Heavy::BEGIN@3 at line 3 of Exporter/Heavy.pm
# once (4µs+0s) by IO::Compress::Gzip::Constants::BEGIN@3 at line 3 of IO/Compress/Gzip/Constants.pm
# once (4µs+0s) by constant::BEGIN@3 at line 3 of constant.pm
# once (4µs+0s) by File::Spec::Unix::BEGIN@3 at line 3 of File/Spec/Unix.pm
# once (4µs+0s) by Cwd::BEGIN@2 at line 2 of Cwd.pm
# once (4µs+0s) by OpenBSD::PackageLocator::BEGIN@18 at line 18 of OpenBSD/PackageRepositoryList.pm
# once (3µs+0s) by File::Basename::BEGIN@50 at line 50 of File/Basename.pm
# once (3µs+0s) by IO::BEGIN@7 at line 7 of IO.pm | ||||
| 61 | 46 | 37µs | shift; | ||
| 62 | 46 | 483µs | 1 | 18µs | $^H |= @_ ? &bits : all_bits | all_explicit_bits; # spent 18µs making 1 call to strict::bits |
| 63 | } | ||||
| 64 | |||||
| 65 | # spent 961µs (253+708) within strict::unimport which was called 20 times, avg 48µs/call:
# once (14µs+463µs) by Compress::Raw::Zlib::BEGIN@113 at line 113 of Compress/Raw/Zlib.pm
# once (34µs+20µs) by Carp::BEGIN@132 at line 132 of Carp.pm
# once (25µs+18µs) by OpenBSD::State::BEGIN@300 at line 300 of OpenBSD/State.pm
# once (20µs+23µs) by Carp::BEGIN@592 at line 592 of Carp.pm
# once (15µs+20µs) by OpenBSD::Auto::BEGIN@29 at line 29 of OpenBSD/Error.pm
# once (15µs+17µs) by List::Util::BEGIN@30 at line 30 of List/Util.pm
# once (14µs+17µs) by Carp::BEGIN@612 at line 612 of Carp.pm
# once (13µs+14µs) by Cwd::BEGIN@691 at line 691 of Cwd.pm
# once (11µs+14µs) by IO::Handle::BEGIN@631 at line 631 of IO/Handle.pm
# once (12µs+10µs) by File::Spec::Unix::BEGIN@182 at line 182 of File/Spec/Unix.pm
# once (9µs+11µs) by constant::BEGIN@40 at line 40 of constant.pm
# once (8µs+11µs) by OpenBSD::State::BEGIN@301 at line 301 of OpenBSD/State.pm
# once (8µs+11µs) by OpenBSD::Getopt::BEGIN@37 at line 37 of OpenBSD/Getopt.pm
# once (8µs+10µs) by constant::BEGIN@65 at line 65 of constant.pm
# once (8µs+10µs) by constant::BEGIN@141 at line 141 of constant.pm
# once (8µs+10µs) by File::Path::BEGIN@29 at line 29 of File/Path.pm
# once (8µs+10µs) by constant::BEGIN@90 at line 90 of constant.pm
# once (7µs+10µs) by Exporter::Heavy::BEGIN@4 at line 4 of Exporter/Heavy.pm
# once (7µs+9µs) by OpenBSD::Getopt::BEGIN@38 at line 38 of OpenBSD/Getopt.pm
# once (9µs+0s) by File::Glob::BEGIN@58 at line 58 of File/Glob.pm | ||||
| 66 | 20 | 18µs | shift; | ||
| 67 | |||||
| 68 | 20 | 146µs | if (@_) { | ||
| 69 | 19 | 512µs | 19 | 708µs | $^H &= ~&bits; # spent 708µs making 19 calls to strict::bits, avg 37µs/call |
| 70 | } | ||||
| 71 | else { | ||||
| 72 | 1 | 2µs | $^H &= ~all_bits; | ||
| 73 | 1 | 1µs | $^H |= all_explicit_bits; | ||
| 74 | } | ||||
| 75 | } | ||||
| 76 | |||||
| 77 | 1 | 7µs | 1; | ||
| 78 | __END__ | ||||
# spent 27µs within strict::CORE:match which was called:
# once (27µs+0s) by strict::BEGIN@7 at line 11 |