← Index
NYTProf Performance Profile   « line view »
For -e
  Run on Thu Mar 24 14:41:10 2016
Reported on Thu Mar 24 14:41:17 2016

Filename/home/s1/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/strict.pm
StatementsExecuted 16 statements in 297µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11140µs40µsstrict::::BEGIN@14strict::BEGIN@14
11132µs32µsstrict::::CORE:regcompstrict::CORE:regcomp (opcode)
1119µs9µsstrict::::CORE:matchstrict::CORE:match (opcode)
1115µs5µ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
31500ns$strict::VERSION = "1.09";
4
5# Verify that we're called correctly so that strictures will work.
6153µs241µsunless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) {
# spent 32µs making 1 call to strict::CORE:regcomp # spent 9µs making 1 call to strict::CORE:match
7 # Can't use Carp, since Carp uses us!
8 my (undef, $f, $l) = caller;
9 die("Incorrect use of pragma '${\__PACKAGE__}' at $f line $l.\n");
10}
11
121200nsmy ( %bitmask, %explicit_bitmask );
13
14
# spent 40µs within strict::BEGIN@14 which was called: # once (40µs+0s) by JSON::Decode::Regexp::BEGIN@7 at line 38
BEGIN {
1512µs %bitmask = (
16 refs => 0x00000002,
17 subs => 0x00000200,
18 vars => 0x00000400,
19 );
20
211800ns %explicit_bitmask = (
22 refs => 0x00000020,
23 subs => 0x00000040,
24 vars => 0x00000080,
25 );
26
271400ns my $bits = 0;
2815µs $bits |= $_ for values %bitmask;
29
301200ns my $inline_all_bits = $bits;
3118µs *all_bits = sub () { $inline_all_bits };
32
331200ns $bits = 0;
3411µs $bits |= $_ for values %explicit_bitmask;
35
361100ns my $inline_all_explicit_bits = $bits;
3719µs *all_explicit_bits = sub () { $inline_all_explicit_bits };
381201µs140µs}
# spent 40µs making 1 call to strict::BEGIN@14
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 5µs within strict::import which was called: # once (5µs+0s) by JSON::Decode::Regexp::BEGIN@7 at line 7 of lib/JSON/Decode/Regexp.pm
sub import {
611300ns shift;
6216µ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
7719µs1;
78__END__
 
# spent 9µs within strict::CORE:match which was called: # once (9µs+0s) by JSON::Decode::Regexp::BEGIN@7 at line 6
sub strict::CORE:match; # opcode
# spent 32µs within strict::CORE:regcomp which was called: # once (32µs+0s) by JSON::Decode::Regexp::BEGIN@7 at line 6
sub strict::CORE:regcomp; # opcode