← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Thu Dec 15 15:23:56 2022
Reported on Thu Dec 15 15:27:01 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/strictures.pm
StatementsExecuted 724 statements in 2.36ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1811406µs12.2msstrictures::::_enable_2strictures::_enable_2
222222265µs385µsstrictures::::VERSIONstrictures::VERSION
222222205µs12.9msstrictures::::importstrictures::import
2211179µs12.7msstrictures::::_enablestrictures::_enable
2221115µs179µsstrictures::::_want_extrastrictures::_want_extra
221142µs42µsstrictures::::_want_extra_envstrictures::_want_extra_env
41141µs269µsstrictures::::_enable_1strictures::_enable_1
221122µs22µsstrictures::::CORE:matchstrictures::CORE:match (opcode)
11117µs18µsstrictures::::BEGIN@3strictures::BEGIN@3
1115µs15µsstrictures::::BEGIN@97strictures::BEGIN@97
1114µs4µsstrictures::::BEGIN@6strictures::BEGIN@6
1113µs21µsstrictures::::BEGIN@4strictures::BEGIN@4
0000s0sstrictures::::_load_extrasstrictures::_load_extras
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package strictures;
2
3223µs219µs
# spent 18µs (17+1) within strictures::BEGIN@3 which was called: # once (17µs+1µs) by OpenAPI::Modern::BEGIN@12 at line 3
use strict;
# spent 18µs making 1 call to strictures::BEGIN@3 # spent 1µs making 1 call to strict::import
4261µs239µs
# spent 21µs (3+18) within strictures::BEGIN@4 which was called: # once (3µs+18µs) by OpenAPI::Modern::BEGIN@12 at line 4
use warnings FATAL => 'all';
# spent 21µs making 1 call to strictures::BEGIN@4 # spent 18µs making 1 call to warnings::import
5
6
# spent 4µs within strictures::BEGIN@6 which was called: # once (4µs+0s) by OpenAPI::Modern::BEGIN@12 at line 11
BEGIN {
712µs *_PERL_LT_5_8_4 = ("$]" < 5.008004) ? sub(){1} : sub(){0};
8 # goto &UNIVERSAL::VERSION usually works on 5.8, but fails on some ARM
9 # machines. Seems to always work on 5.10 though.
1012µs *_CAN_GOTO_VERSION = ("$]" >= 5.010000) ? sub(){1} : sub(){0};
11194µs14µs}
# spent 4µs making 1 call to strictures::BEGIN@6
12
1310sour $VERSION = '2.000006';
1411µs$VERSION =~ tr/_//d;
15
16114µsour @WARNING_CATEGORIES = grep { exists $warnings::Offsets{$_} } qw(
17 closure
18 chmod
19 deprecated
20 exiting
21 experimental
22 experimental::alpha_assertions
23 experimental::autoderef
24 experimental::bitwise
25 experimental::const_attr
26 experimental::declared_refs
27 experimental::lexical_subs
28 experimental::lexical_topic
29 experimental::postderef
30 experimental::private_use
31 experimental::re_strict
32 experimental::refaliasing
33 experimental::regex_sets
34 experimental::script_run
35 experimental::signatures
36 experimental::smartmatch
37 experimental::win32_perlio
38 glob
39 imprecision
40 io
41 closed
42 exec
43 layer
44 newline
45 pipe
46 syscalls
47 unopened
48 locale
49 misc
50 missing
51 numeric
52 once
53 overflow
54 pack
55 portable
56 recursion
57 redefine
58 redundant
59 regexp
60 severe
61 debugging
62 inplace
63 internal
64 malloc
65 shadow
66 signal
67 substr
68 syntax
69 ambiguous
70 bareword
71 digit
72 illegalproto
73 parenthesis
74 precedence
75 printf
76 prototype
77 qw
78 reserved
79 semicolon
80 taint
81 threads
82 uninitialized
83 umask
84 unpack
85 untie
86 utf8
87 non_unicode
88 nonchar
89 surrogate
90 void
91 void_unusual
92 y2k
93);
94
95
# spent 385µs (265+120) within strictures::VERSION which was called 22 times, avg 18µs/call: # once (22µs+8µs) by Data::Perl::Role::Collection::Array::BEGIN@5 at line 5 of Data/Perl/Role/Collection/Array.pm # once (14µs+13µs) by JSON::Schema::Modern::Vocabulary::MetaData::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/MetaData.pm # once (15µs+8µs) by Data::Perl::Collection::Array::MooseLike::BEGIN@5 at line 5 of Data/Perl/Collection/Array/MooseLike.pm # once (16µs+6µs) by Data::Perl::Collection::Hash::MooseLike::BEGIN@5 at line 5 of Data/Perl/Collection/Hash/MooseLike.pm # once (13µs+6µs) by OpenAPI::Modern::BEGIN@12 at line 12 of OpenAPI/Modern.pm # once (13µs+6µs) by JSON::Schema::Modern::Vocabulary::Unevaluated::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Unevaluated.pm # once (12µs+6µs) by Data::Perl::Role::Collection::Hash::BEGIN@5 at line 5 of Data/Perl/Role/Collection/Hash.pm # once (13µs+5µs) by JSON::Schema::Modern::Document::OpenAPI::BEGIN@12 at line 12 of JSON/Schema/Modern/Document/OpenAPI.pm # once (13µs+4µs) by JSON::Schema::Modern::Utilities::BEGIN@10 at line 10 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Utilities.pm # once (12µs+5µs) by JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Applicator.pm # once (11µs+5µs) by JSON::Schema::Modern::Result::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Result.pm # once (12µs+4µs) by JSON::Schema::Modern::Vocabulary::Core::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Core.pm # once (10µs+6µs) by JSON::Schema::Modern::Vocabulary::Validation::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Validation.pm # once (11µs+5µs) by JSON::Schema::Modern::Vocabulary::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary.pm # once (11µs+4µs) by JSON::Schema::Modern::Vocabulary::FormatAssertion::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/FormatAssertion.pm # once (11µs+4µs) by JSON::Schema::Modern::BEGIN@12 at line 12 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm # once (11µs+4µs) by JSON::Schema::Modern::Error::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Error.pm # once (11µs+4µs) by JSON::Schema::Modern::Vocabulary::OpenAPI::BEGIN@11 at line 11 of JSON/Schema/Modern/Vocabulary/OpenAPI.pm # once (9µs+5µs) by JSON::Schema::Modern::Vocabulary::FormatAnnotation::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/FormatAnnotation.pm # once (9µs+4µs) by JSON::Schema::Modern::Document::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Document.pm # once (8µs+4µs) by JSON::Schema::Modern::Vocabulary::Content::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Content.pm # once (8µs+4µs) by JSON::Schema::Modern::Annotation::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Annotation.pm
sub VERSION {
96 {
9724644µs225µs
# spent 15µs (5+10) within strictures::BEGIN@97 which was called: # once (5µs+10µs) by OpenAPI::Modern::BEGIN@12 at line 97
no warnings;
# spent 15µs making 1 call to strictures::BEGIN@97 # spent 10µs making 1 call to warnings::unimport
98222µs local $@;
9966260µs22120µs if (defined $_[1] && eval { &UNIVERSAL::VERSION; 1}) {
# spent 120µs making 22 calls to UNIVERSAL::VERSION, avg 5µs/call
1002226µs $^H |= 0x20000
101 unless _PERL_LT_5_8_4;
1022247µs $^H{strictures_enable} = int $_[1];
103 }
104 }
10522222µs228µs _CAN_GOTO_VERSION ? goto &UNIVERSAL::VERSION : &UNIVERSAL::VERSION;
# spent 8µs making 22 calls to UNIVERSAL::VERSION, avg 364ns/call
106}
107
108our %extra_load_states;
109
110our $Smells_Like_VCS;
111
112
# spent 12.9ms (205µs+12.7) within strictures::import which was called 22 times, avg 586µs/call: # once (10µs+1.08ms) by JSON::Schema::Modern::Utilities::BEGIN@10 at line 10 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Utilities.pm # once (25µs+866µs) by JSON::Schema::Modern::Document::OpenAPI::BEGIN@12 at line 12 of JSON/Schema/Modern/Document/OpenAPI.pm # once (10µs+865µs) by JSON::Schema::Modern::Vocabulary::MetaData::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/MetaData.pm # once (8µs+824µs) by JSON::Schema::Modern::Vocabulary::Validation::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Validation.pm # once (7µs+796µs) by JSON::Schema::Modern::Annotation::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Annotation.pm # once (8µs+739µs) by JSON::Schema::Modern::Vocabulary::Core::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Core.pm # once (7µs+683µs) by JSON::Schema::Modern::Vocabulary::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary.pm # once (9µs+638µs) by JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Applicator.pm # once (7µs+636µs) by JSON::Schema::Modern::Vocabulary::FormatAnnotation::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/FormatAnnotation.pm # once (10µs+620µs) by JSON::Schema::Modern::Vocabulary::Unevaluated::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Unevaluated.pm # once (9µs+607µs) by JSON::Schema::Modern::Error::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Error.pm # once (7µs+596µs) by OpenAPI::Modern::BEGIN@12 at line 12 of OpenAPI/Modern.pm # once (8µs+594µs) by JSON::Schema::Modern::BEGIN@12 at line 12 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm # once (8µs+589µs) by JSON::Schema::Modern::Result::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Result.pm # once (7µs+570µs) by JSON::Schema::Modern::Vocabulary::Content::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Content.pm # once (7µs+567µs) by JSON::Schema::Modern::Vocabulary::FormatAssertion::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/FormatAssertion.pm # once (9µs+565µs) by JSON::Schema::Modern::Vocabulary::OpenAPI::BEGIN@11 at line 11 of JSON/Schema/Modern/Vocabulary/OpenAPI.pm # once (6µs+542µs) by JSON::Schema::Modern::Document::BEGIN@11 at line 11 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Document.pm # once (15µs+93µs) by Data::Perl::Role::Collection::Array::BEGIN@5 at line 5 of Data/Perl/Role/Collection/Array.pm # once (13µs+84µs) by Data::Perl::Collection::Array::MooseLike::BEGIN@5 at line 5 of Data/Perl/Collection/Array/MooseLike.pm # once (9µs+87µs) by Data::Perl::Collection::Hash::MooseLike::BEGIN@5 at line 5 of Data/Perl/Collection/Hash/MooseLike.pm # once (6µs+47µs) by Data::Perl::Role::Collection::Hash::BEGIN@5 at line 5 of Data/Perl/Role/Collection/Hash.pm
sub import {
113225µs my $class = shift;
1142232µs my %opts = @_ == 1 ? %{$_[0]} : @_;
1152245µs if (!exists $opts{version}) {
116 $opts{version}
117 = exists $^H{strictures_enable} ? delete $^H{strictures_enable}
118 : int $VERSION;
119 }
1202252µs $opts{file} = (caller)[1];
12122116µs2212.7ms $class->_enable(\%opts);
# spent 12.7ms making 22 calls to strictures::_enable, avg 577µs/call
122}
123
124
# spent 12.7ms (179µs+12.5) within strictures::_enable which was called 22 times, avg 577µs/call: # 22 times (179µs+12.5ms) by strictures::import at line 121, avg 577µs/call
sub _enable {
1252224µs my ($class, $opts) = @_;
1262217µs my $version = $opts->{version};
127224µs $version = 'undef'
128 if !defined $version;
1292214µs my $method = "_enable_$version";
1302288µs2232µs if (!$class->can($method)) {
# spent 32µs making 22 calls to UNIVERSAL::can, avg 1µs/call
131 require Carp;
132 Carp::croak("Major version specified as $version - not supported!");
133 }
1342265µs2212.5ms $class->$method($opts);
# spent 12.2ms making 18 calls to strictures::_enable_2, avg 678µs/call # spent 269µs making 4 calls to strictures::_enable_1, avg 67µs/call
135}
136
137
# spent 269µs (41+228) within strictures::_enable_1 which was called 4 times, avg 67µs/call: # 4 times (41µs+228µs) by strictures::_enable at line 134, avg 67µs/call
sub _enable_1 {
13840s my ($class, $opts) = @_;
139418µs48µs strict->import;
# spent 8µs making 4 calls to strict::import, avg 2µs/call
140412µs4186µs warnings->import(FATAL => 'all');
# spent 186µs making 4 calls to warnings::import, avg 46µs/call
141
142416µs434µs if (_want_extra($opts->{file})) {
# spent 34µs making 4 calls to strictures::_want_extra, avg 8µs/call
143 _load_extras(qw(indirect multidimensional bareword::filehandles));
144 indirect->unimport(':fatal')
145 if $extra_load_states{indirect};
146 multidimensional->unimport
147 if $extra_load_states{multidimensional};
148 bareword::filehandles->unimport
149 if $extra_load_states{'bareword::filehandles'};
150 }
151}
152
15312µsour @V2_NONFATAL = grep { exists $warnings::Offsets{$_} } (
154 'exec', # not safe to catch
155 'recursion', # will be caught by other mechanisms
156 'internal', # not safe to catch
157 'malloc', # not safe to catch
158 'newline', # stat on nonexistent file with a newline in it
159 'experimental', # no reason for these to be fatal
160 'deprecated', # unfortunately can't make these fatal
161 'portable', # everything worked fine here, just may not elsewhere
162);
16310sour @V2_DISABLE = grep { exists $warnings::Offsets{$_} } (
164 'once' # triggers inconsistently, can't be fatalized
165);
166
167
# spent 12.2ms (406µs+11.8) within strictures::_enable_2 which was called 18 times, avg 678µs/call: # 18 times (406µs+11.8ms) by strictures::_enable at line 134, avg 678µs/call
sub _enable_2 {
1681810µs my ($class, $opts) = @_;
1691847µs1817µs strict->import;
# spent 17µs making 18 calls to strict::import, avg 944ns/call
1701824µs18339µs warnings->import;
# spent 339µs making 18 calls to warnings::import, avg 19µs/call
1711853µs189.96ms warnings->import(FATAL => @WARNING_CATEGORIES);
# spent 9.96ms making 18 calls to warnings::import, avg 553µs/call
1721828µs18274µs warnings->unimport(FATAL => @V2_NONFATAL);
# spent 274µs making 18 calls to warnings::unimport, avg 15µs/call
1731816µs181.00ms warnings->import(@V2_NONFATAL);
# spent 1.00ms making 18 calls to warnings::import, avg 56µs/call
1741817µs1864µs warnings->unimport(@V2_DISABLE);
# spent 64µs making 18 calls to warnings::unimport, avg 4µs/call
175
1761860µs18145µs if (_want_extra($opts->{file})) {
# spent 145µs making 18 calls to strictures::_want_extra, avg 8µs/call
177 _load_extras(qw(indirect multidimensional bareword::filehandles));
178 indirect->unimport(':fatal')
179 if $extra_load_states{indirect};
180 multidimensional->unimport
181 if $extra_load_states{multidimensional};
182 bareword::filehandles->unimport
183 if $extra_load_states{'bareword::filehandles'};
184 }
185}
186
187
# spent 42µs within strictures::_want_extra_env which was called 22 times, avg 2µs/call: # 22 times (42µs+0s) by strictures::_want_extra at line 200, avg 2µs/call
sub _want_extra_env {
1882219µs if (exists $ENV{PERL_STRICTURES_EXTRA}) {
189 if (_PERL_LT_5_8_4 and $ENV{PERL_STRICTURES_EXTRA}) {
190 die 'PERL_STRICTURES_EXTRA checks are not available on perls older'
191 . "than 5.8.4: please unset \$ENV{PERL_STRICTURES_EXTRA}\n";
192 }
193 return $ENV{PERL_STRICTURES_EXTRA} ? 1 : 0;
194 }
1952228µs return undef;
196}
197
198
# spent 179µs (115+64) within strictures::_want_extra which was called 22 times, avg 8µs/call: # 18 times (91µs+54µs) by strictures::_enable_2 at line 176, avg 8µs/call # 4 times (24µs+10µs) by strictures::_enable_1 at line 142, avg 8µs/call
sub _want_extra {
1992213µs my $file = shift;
2002232µs2242µs my $want_env = _want_extra_env();
# spent 42µs making 22 calls to strictures::_want_extra_env, avg 2µs/call
201226µs return $want_env
202 if defined $want_env;
203 return (
2042288µs2222µs !_PERL_LT_5_8_4
# spent 22µs making 22 calls to strictures::CORE:match, avg 1µs/call
205 and $file =~ /^(?:t|xt|lib|blib)[\\\/]/
206 and defined $Smells_Like_VCS ? $Smells_Like_VCS
207 : ( $Smells_Like_VCS = !!(
208 -e '.git' || -e '.svn' || -e '.hg' || -e '.bzr'
209 || (-e '../../dist.ini'
210 && (-e '../../.git' || -e '../../.svn' || -e '../../.hg' || -e '../../.bzr' ))
211 ))
212 );
213}
214
215sub _load_extras {
216 my @extras = @_;
217 my @failed;
218 foreach my $mod (@extras) {
219 next
220 if exists $extra_load_states{$mod};
221
222 $extra_load_states{$mod} = eval "require $mod; 1;" or do {
223 push @failed, $mod;
224
225 #work around 5.8 require bug
226 (my $file = $mod) =~ s|::|/|g;
227 delete $INC{"${file}.pm"};
228 };
229 }
230
231 if (@failed) {
232 my $failed = join ' ', @failed;
233 my $extras = join ' ', @extras;
234 print STDERR <<EOE;
235strictures.pm extra testing active but couldn't load all modules. Missing were:
236
237 $failed
238
239Extra testing is auto-enabled in checkouts only, so if you're the author
240of a strictures-using module you need to run:
241
242 cpan $extras
243
244but these modules are not required by your users.
245EOE
246 }
247}
248
24918µs1;
250
251__END__
 
# spent 22µs within strictures::CORE:match which was called 22 times, avg 1µs/call: # 22 times (22µs+0s) by strictures::_want_extra at line 204, avg 1µs/call
sub strictures::CORE:match; # opcode