← Index
NYTProf Performance Profile   « line view »
For term-colors.pl
  Run on Thu Dec 21 13:47:32 2023
Reported on Thu Dec 21 13:55:07 2023

Filename/usr/share/perl5/strict.pm
StatementsExecuted 16 statements in 150µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11119µs22µsstrict::::BEGIN@7strict::BEGIN@7
1113µs3µsstrict::::CORE:matchstrict::CORE:match (opcode)
1112µs2µsstrict::::importstrict::import
0000s0sstrict::::__ANON__[:31]strict::__ANON__[:31]
0000s0sstrict::::__ANON__[:37]strict::__ANON__[:37]
0000s0sstrict::::bitsstrict::bits
0000s0sstrict::::unimportstrict::unimport
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
31300ns$strict::VERSION = "1.11";
4
51100nsmy ( %bitmask, %explicit_bitmask );
6
7
# spent 22µs (19+3) within strict::BEGIN@7 which was called: # once (19µs+3µs) by main::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.
1116µs13µs die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2]
# spent 3µ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
211300ns %explicit_bitmask = (
22 refs => 0x00000020,
23 subs => 0x00000040,
24 vars => 0x00000080,
25 );
26
271200ns my $bits = 0;
2811µs $bits |= $_ for values %bitmask;
29
301100ns my $inline_all_bits = $bits;
3115µs *all_bits = sub () { $inline_all_bits };
32
331100ns $bits = 0;
341600ns $bits |= $_ for values %explicit_bitmask;
35
361100ns my $inline_all_explicit_bits = $bits;
3713µs *all_explicit_bits = sub () { $inline_all_explicit_bits };
381125µs122µs}
# spent 22µs making 1 call to strict::BEGIN@7
39
40sub bits {
41 my $bits = 0;
42 my @wrong;
43 foreach my $s (@_) {
44 if (exists $bitmask{$s}) {
45 $^H |= $explicit_bitmask{$s};
46
47 $bits |= $bitmask{$s};
48 }
49 else {
50 push @wrong, $s;
51 }
52 }
53 if (@wrong) {
54 require Carp;
55 Carp::croak("Unknown 'strict' tag(s) '@wrong'");
56 }
57 $bits;
58}
59
60
# spent 2µs within strict::import which was called: # once (2µs+0s) by main::BEGIN@3 at line 3 of /home/bakers/term-colors.pl
sub import {
611200ns shift;
6214µs $^H |= @_ ? &bits : all_bits | all_explicit_bits;
63}
64
65sub unimport {
66 shift;
67
68 if (@_) {
69 $^H &= ~&bits;
70 }
71 else {
72 $^H &= ~all_bits;
73 $^H |= all_explicit_bits;
74 }
75}
76
7712µs1;
78__END__
 
# spent 3µs within strict::CORE:match which was called: # once (3µs+0s) by strict::BEGIN@7 at line 11
sub strict::CORE:match; # opcode