Profile of strict.pm

← Index
NYTProf Performance Profile «line view»
For test.pl
Run on Mon Apr 5 14:31:27 2021
Reported on Mon Apr 5 14:31:40 2021

Filename | /home/leont/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/strict.pm
Statements | Executed 183 statements in 254µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
13 | 13 | 7 | 39µs | 72µs | strict::::unimportstrict::unimport
13 | 1 | 1 | 34µs | 34µs | strict::::bitsstrict::bits
1 | 1 | 1 | 28µs | 32µs | strict::::BEGIN@7strict::BEGIN@7
13 | 13 | 13 | 16µs | 16µs | strict::::importstrict::import
1 | 1 | 1 | 4µs | 4µs | strict::::CORE:matchstrict::CORE:match (opcode)
0 | 0 | 0 | 0s | 0s | strict::::__ANON__[:31]strict::__ANON__[:31]
0 | 0 | 0 | 0s | 0s | strict::::__ANON__[:37]strict::__ANON__[:37]

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package strict;
2 |  |  |  |  |
3 | 1 | 200ns |  |  | $strict::VERSION = "1.11";
4 |  |  |  |  |
5 | 1 | 100ns |  |  | my ( %bitmask, %explicit_bitmask );
6 |  |  |  |  |
7 |  |  |  |  | # spent 32µs (28+4) within strict::BEGIN@7 which was called: # once (28µs+4µs) by experimental::BEGIN@3 at line 38 BEGIN {
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 | 15µs | 1 | 4µs | die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2] # spent 4µ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 | 800ns |  |  | %bitmask = (
16 |  |  |  |  | refs => 0x00000002,
17 |  |  |  |  | subs => 0x00000200,
18 |  |  |  |  | vars => 0x00000400,
19 |  |  |  |  | );
20 |  |  |  |  |
21 | 1 | 300ns |  |  | %explicit_bitmask = (
22 |  |  |  |  | refs => 0x00000020,
23 |  |  |  |  | subs => 0x00000040,
24 |  |  |  |  | vars => 0x00000080,
25 |  |  |  |  | );
26 |  |  |  |  |
27 | 1 | 100ns |  |  | my $bits = 0;
28 | 1 | 2µs |  |  | $bits |= $_ for values %bitmask;
29 |  |  |  |  |
30 | 1 | 100ns |  |  | my $inline_all_bits = $bits;
31 | 1 | 4µs |  |  | *all_bits = sub () { $inline_all_bits };
32 |  |  |  |  |
33 | 1 | 100ns |  |  | $bits = 0;
34 | 1 | 700ns |  |  | $bits |= $_ for values %explicit_bitmask;
35 |  |  |  |  |
36 | 1 | 100ns |  |  | my $inline_all_explicit_bits = $bits;
37 | 1 | 5µs |  |  | *all_explicit_bits = sub () { $inline_all_explicit_bits };
38 | 1 | 106µs | 1 | 32µs | } # spent 32µs making 1 call to strict::BEGIN@7
39 |  |  |  |  |
40 |  |  |  |  | # spent 34µs within strict::bits which was called 13 times, avg 3µs/call: # 13 times (34µs+0s) by strict::unimport at line 69, avg 3µs/call sub bits {
41 | 13 | 2µs |  |  | my $bits = 0;
42 | 13 | 1µs |  |  | my @wrong;
43 | 13 | 4µs |  |  | foreach my $s (@_) {
44 | 13 | 7µs |  |  | if (exists $bitmask{$s}) {
45 | 13 | 9µs |  |  | $^H |= $explicit_bitmask{$s};
46 |  |  |  |  |
47 | 13 | 3µs |  |  | $bits |= $bitmask{$s};
48 |  |  |  |  | }
49 |  |  |  |  | else {
50 |  |  |  |  | push @wrong, $s;
51 |  |  |  |  | }
52 |  |  |  |  | }
53 | 13 | 1µs |  |  | if (@wrong) {
54 |  |  |  |  | require Carp;
55 |  |  |  |  | Carp::croak("Unknown 'strict' tag(s) '@wrong'");
56 |  |  |  |  | }
57 | 13 | 26µs |  |  | $bits;
58 |  |  |  |  | }
59 |  |  |  |  |
60 |  |  |  |  | # spent 16µs within strict::import which was called 13 times, avg 1µs/call: # once (2µs+0s) by experimental::BEGIN@3 at line 3 of experimental.pm # once (2µs+0s) by List::Util::BEGIN@9 at line 9 of List/Util.pm # once (1µs+0s) by CPAN::Meta::Converter::BEGIN@2.7 at line 2 of Parse/CPAN/Meta.pm # once (1µs+0s) by CPAN::Meta::Prereqs::BEGIN@2 at line 2 of CPAN/Meta/Requirements.pm # once (1µs+0s) by Carp::BEGIN@4 at line 4 of Carp.pm # once (1µs+0s) by CPAN::Meta::BEGIN@2 at line 2 of CPAN/Meta/Feature.pm # once (1µs+0s) by version::BEGIN@5 at line 5 of version.pm # once (1µs+0s) by CPAN::Meta::BEGIN@2.4 at line 2 of CPAN/Meta/Converter.pm # once (1µs+0s) by main::BEGIN@2.1 at line 2 of CPAN/Meta.pm # once (1µs+0s) by Scalar::Util::BEGIN@9 at line 9 of Scalar/Util.pm # once (1µs+0s) by version::regex::BEGIN@3 at line 3 of version/regex.pm # once (900ns+0s) by CPAN::Meta::Feature::BEGIN@2 at line 2 of CPAN/Meta/Prereqs.pm # once (800ns+0s) by CPAN::Meta::Converter::BEGIN@2 at line 2 of CPAN/Meta/Validator.pm sub import {
61 | 13 | 2µs |  |  | shift;
62 | 13 | 31µs |  |  | $^H |= @_ ? &bits : all_bits | all_explicit_bits;
63 |  |  |  |  | }
64 |  |  |  |  |
65 |  |  |  |  | # spent 72µs (39+33) within strict::unimport which was called 13 times, avg 6µs/call: # once (6µs+3µs) by CPAN::Meta::Requirements::BEGIN@229 at line 229 of CPAN/Meta/Requirements.pm # once (5µs+2µs) by version::BEGIN@27 at line 27 of version.pm # once (3µs+3µs) by CPAN::Meta::BEGIN@625 at line 625 of CPAN/Meta.pm # once (3µs+3µs) by Carp::BEGIN@730 at line 730 of Carp.pm # once (3µs+3µs) by CPAN::Meta::Converter::BEGIN@506 at line 506 of CPAN/Meta/Converter.pm # once (2µs+3µs) by CPAN::Meta::BEGIN@93 at line 93 of CPAN/Meta.pm # once (3µs+3µs) by Carp::BEGIN@256 at line 256 of Carp.pm # once (2µs+3µs) by Carp::BEGIN@188 at line 188 of Carp.pm # once (3µs+2µs) by Parse::CPAN::Meta::BEGIN@47 at line 47 of Parse/CPAN/Meta.pm # once (2µs+2µs) by List::Util::BEGIN@35 at line 35 of List/Util.pm # once (2µs+2µs) by CPAN::Meta::BEGIN@162 at line 162 of CPAN/Meta.pm # once (2µs+2µs) by CPAN::Meta::BEGIN@121 at line 121 of CPAN/Meta.pm # once (2µs+2µs) by Carp::BEGIN@751 at line 751 of Carp.pm sub unimport {
66 | 13 | 1µs |  |  | shift;
67 |  |  |  |  |
68 | 13 | 21µs |  |  | if (@_) {
69 | 13 | 10µs | 13 | 34µs | $^H &= ~&bits; # spent 34µs making 13 calls to strict::bits, avg 3µs/call
70 |  |  |  |  | }
71 |  |  |  |  | else {
72 |  |  |  |  | $^H &= ~all_bits;
73 |  |  |  |  | $^H |= all_explicit_bits;
74 |  |  |  |  | }
75 |  |  |  |  | }
76 |  |  |  |  |
77 | 1 | 2µs |  |  | 1;
78 |  |  |  |  | __END__
|  |  |  |  | # spent 4µs within strict::CORE:match which was called: # once (4µs+0s) by strict::BEGIN@7 at line 11 sub strict::CORE:match; # opcode