← Index
NYTProf Performance Profile   « line view »
For v4.pl
  Run on Fri Sep 20 21:30:49 2019
Reported on Fri Sep 20 21:31:41 2019

Filename/usr/share/perl/5.26/strict.pm
StatementsExecuted 77 statements in 165µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11119µs24µsstrict::::BEGIN@7strict::BEGIN@7
55314µs27µsstrict::::unimportstrict::unimport
51113µs13µsstrict::::bitsstrict::bits
4446µs6µsstrict::::importstrict::import
1115µs5µ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 24µs (19+5) within strict::BEGIN@7 which was called: # once (19µs+5µs) by main::BEGIN@29 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.
1119µs15µs die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2]
# spent 5µ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
1511µs %bitmask = (
16 refs => 0x00000002,
17 subs => 0x00000200,
18 vars => 0x00000400,
19 );
20
211400ns %explicit_bitmask = (
22 refs => 0x00000020,
23 subs => 0x00000040,
24 vars => 0x00000080,
25 );
26
271200ns my $bits = 0;
2812µs $bits |= $_ for values %bitmask;
29
301100ns my $inline_all_bits = $bits;
3115µs *all_bits = sub () { $inline_all_bits };
32
331100ns $bits = 0;
341500ns $bits |= $_ for values %explicit_bitmask;
35
361100ns my $inline_all_explicit_bits = $bits;
3714µs *all_explicit_bits = sub () { $inline_all_explicit_bits };
38199µs124µs}
# spent 24µs making 1 call to strict::BEGIN@7
39
40
# spent 13µs within strict::bits which was called 5 times, avg 3µs/call: # 5 times (13µs+0s) by strict::unimport at line 69, avg 3µs/call
sub bits {
4151µs my $bits = 0;
425600ns my @wrong;
4352µs foreach my $s (@_) {
4452µs if (exists $bitmask{$s}) {
4553µs $^H |= $explicit_bitmask{$s};
46
4751µs $bits |= $bitmask{$s};
48 }
49 else {
50 push @wrong, $s;
51 }
52 }
5351µs if (@wrong) {
54 require Carp;
55 Carp::croak("Unknown 'strict' tag(s) '@wrong'");
56 }
5759µs $bits;
58}
59
60
# spent 6µs within strict::import which was called 4 times, avg 1µs/call: # once (2µs+0s) by main::BEGIN@29 at line 29 of /homes/dcw/src/perl/weeklychallenge/perlweeklychallenge-club/challenge-025/duncan-c-white/perl5/v4.pl # once (1µs+0s) by List::Util::BEGIN@9 at line 9 of List/Util.pm # once (1µs+0s) by Scalar::Util::BEGIN@9 at line 9 of Scalar/Util.pm # once (1µs+0s) by Carp::BEGIN@4 at line 4 of Carp.pm
sub import {
614500ns shift;
62410µs $^H |= @_ ? &bits : all_bits | all_explicit_bits;
63}
64
65
# spent 27µs (14+13) within strict::unimport which was called 5 times, avg 5µs/call: # once (3µs+3µs) by Carp::BEGIN@592 at line 592 of Carp.pm # once (3µs+3µs) by Carp::BEGIN@132 at line 132 of Carp.pm # once (3µs+3µs) by Function::Parameters::BEGIN@80 at line 80 of Function/Parameters.pm # once (2µs+3µs) by List::Util::BEGIN@31 at line 31 of List/Util.pm # once (2µs+2µs) by Carp::BEGIN@612 at line 612 of Carp.pm
sub unimport {
665600ns shift;
67
6857µs if (@_) {
6954µs513µs $^H &= ~&bits;
# spent 13µs making 5 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 5µs within strict::CORE:match which was called: # once (5µs+0s) by strict::BEGIN@7 at line 11
sub strict::CORE:match; # opcode