← 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
StatementsExecuted 183 statements in 254µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1313739µs72µsstrict::::unimportstrict::unimport
131134µs34µsstrict::::bitsstrict::bits
11128µs32µsstrict::::BEGIN@7strict::BEGIN@7
13131316µs16µsstrict::::importstrict::import
1114µs4µsstrict::::CORE:matchstrict::CORE:match (opcode)
0000s0sstrict::::__ANON__[:31]strict::__ANON__[:31]
0000s0sstrict::::__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
1package strict;
2
31200ns$strict::VERSION = "1.11";
4
51100nsmy ( %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.
11115µs14µ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
151800ns %bitmask = (
16 refs => 0x00000002,
17 subs => 0x00000200,
18 vars => 0x00000400,
19 );
20
211300ns %explicit_bitmask = (
22 refs => 0x00000020,
23 subs => 0x00000040,
24 vars => 0x00000080,
25 );
26
271100ns my $bits = 0;
2812µs $bits |= $_ for values %bitmask;
29
301100ns my $inline_all_bits = $bits;
3114µs *all_bits = sub () { $inline_all_bits };
32
331100ns $bits = 0;
341700ns $bits |= $_ for values %explicit_bitmask;
35
361100ns my $inline_all_explicit_bits = $bits;
3715µs *all_explicit_bits = sub () { $inline_all_explicit_bits };
381106µs132µ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 {
41132µs my $bits = 0;
42131µs my @wrong;
43134µs foreach my $s (@_) {
44137µs if (exists $bitmask{$s}) {
45139µs $^H |= $explicit_bitmask{$s};
46
47133µs $bits |= $bitmask{$s};
48 }
49 else {
50 push @wrong, $s;
51 }
52 }
53131µs if (@wrong) {
54 require Carp;
55 Carp::croak("Unknown 'strict' tag(s) '@wrong'");
56 }
571326µ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 {
61132µs shift;
621331µ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 {
66131µs shift;
67
681321µs if (@_) {
691310µs1334µ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
7712µs1;
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