Filename | /usr/share/perl5/strictures.pm |
Statements | Executed 260 statements in 1.30ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
36 | 36 | 35 | 390µs | 1.34ms | import | strictures::
11 | 11 | 11 | 93µs | 185µs | VERSION | strictures::
36 | 1 | 1 | 51µs | 51µs | CORE:match (opcode) | strictures::
1 | 1 | 1 | 11µs | 26µs | BEGIN@3 | strictures::
1 | 1 | 1 | 9µs | 20µs | BEGIN@22 | strictures::
1 | 1 | 1 | 7µs | 31µs | BEGIN@4 | strictures::
4 | 1 | 1 | 7µs | 7µs | CORE:ftis (opcode) | strictures::
1 | 1 | 1 | 5µs | 5µs | BEGIN@6 | strictures::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package strictures; | ||||
2 | |||||
3 | 2 | 32µs | 2 | 40µs | # spent 26µs (11+14) within strictures::BEGIN@3 which was called:
# once (11µs+14µs) by Moo::BEGIN@3 at line 3 # spent 26µs making 1 call to strictures::BEGIN@3
# spent 14µs making 1 call to strict::import |
4 | 2 | 62µs | 2 | 54µs | # spent 31µs (7+23) within strictures::BEGIN@4 which was called:
# once (7µs+23µs) by Moo::BEGIN@3 at line 4 # spent 31µs making 1 call to strictures::BEGIN@4
# spent 23µs making 1 call to warnings::import |
5 | |||||
6 | # spent 5µs within strictures::BEGIN@6 which was called:
# once (5µs+0s) by Moo::BEGIN@3 at line 8 | ||||
7 | 1 | 6µs | *_PERL_LT_5_8_4 = ($] < 5.008004) ? sub(){1} : sub(){0}; | ||
8 | 1 | 82µs | 1 | 5µs | } # spent 5µs making 1 call to strictures::BEGIN@6 |
9 | |||||
10 | 1 | 800ns | our $VERSION = '1.005002'; # 1.5.2 | ||
11 | |||||
12 | # spent 185µs (93+92) within strictures::VERSION which was called 11 times, avg 17µs/call:
# once (9µs+11µs) by Moo::sification::BEGIN@3 at line 3 of Moo/sification.pm
# once (12µs+7µs) by Moo::BEGIN@3 at line 3 of Moo.pm
# once (11µs+8µs) by Method::Generate::Constructor::BEGIN@3 at line 3 of Method/Generate/Constructor.pm
# once (8µs+10µs) by Moo::Object::BEGIN@3 at line 3 of Moo/Object.pm
# once (8µs+10µs) by Sub::Quote::BEGIN@3 at line 3 of Sub/Quote.pm
# once (9µs+8µs) by Method::Generate::BuildAll::BEGIN@3 at line 3 of Method/Generate/BuildAll.pm
# once (8µs+8µs) by Method::Generate::Accessor::BEGIN@3 at line 3 of Method/Generate/Accessor.pm
# once (8µs+7µs) by Moo::Role::BEGIN@3 at line 3 of Moo/Role.pm
# once (8µs+8µs) by Sub::Defer::BEGIN@3 at line 3 of Sub/Defer.pm
# once (8µs+7µs) by Moo::HandleMoose::_TypeMap::BEGIN@2 at line 2 of Moo/HandleMoose/_TypeMap.pm
# once (7µs+7µs) by Moo::_Utils::BEGIN@11 at line 11 of Moo/_Utils.pm | ||||
13 | 11 | 9µs | for ($_[1]) { | ||
14 | 11 | 16µs | last unless defined && !ref && int != 1; | ||
15 | die "Major version specified as $_ - this is strictures version 1"; | ||||
16 | } | ||||
17 | # disable this since Foo->VERSION(undef) correctly returns the version | ||||
18 | # and that can happen either if our caller passes undef explicitly or | ||||
19 | # because the for above autovivified $_[1] - I could make it stop but | ||||
20 | # it's pointless since we don't want to blow up if the caller does | ||||
21 | # something valid either. | ||||
22 | 2 | 395µs | 2 | 30µs | # spent 20µs (9+11) within strictures::BEGIN@22 which was called:
# once (9µs+11µs) by Moo::BEGIN@3 at line 22 # spent 20µs making 1 call to strictures::BEGIN@22
# spent 11µs making 1 call to warnings::unimport |
23 | 11 | 189µs | 11 | 92µs | shift->SUPER::VERSION(@_); # spent 92µs making 11 calls to UNIVERSAL::VERSION, avg 8µs/call |
24 | } | ||||
25 | |||||
26 | 1 | 100ns | our $extra_load_states; | ||
27 | |||||
28 | 1 | 18µs | 4 | 7µs | our $Smells_Like_VCS = (-e '.git' || -e '.svn' || -e '.hg' # spent 7µs making 4 calls to strictures::CORE:ftis, avg 2µs/call |
29 | || (-e '../../dist.ini' | ||||
30 | && (-e '../../.git' || -e '../../.svn' || -e '../../.hg' ))); | ||||
31 | |||||
32 | # spent 1.34ms (390µs+947µs) within strictures::import which was called 36 times, avg 37µs/call:
# once (22µs+48µs) by Search::Elasticsearch::Serializer::JSON::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Serializer/JSON.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Serializer/JSON.pm
# once (12µs+29µs) by Search::Elasticsearch::Bulk::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Bulk.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Bulk.pm
# once (14µs+25µs) by Moo::BEGIN@3 at line 3 of Moo.pm
# once (10µs+28µs) by Method::Generate::Constructor::__ANON__[/usr/share/perl5/Method/Generate/Constructor.pm:197] at line 197 of Method/Generate/Constructor.pm
# once (11µs+26µs) by Search::Elasticsearch::Role::Client::Direct::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client/Direct.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client/Direct.pm
# once (10µs+27µs) by Search::Elasticsearch::Cxn::HTTPTiny::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Cxn/HTTPTiny.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Cxn/HTTPTiny.pm
# once (11µs+26µs) by Search::Elasticsearch::Role::Serializer::JSON::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Serializer/JSON.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Serializer/JSON.pm
# once (11µs+26µs) by Search::Elasticsearch::Role::Cxn::HTTP::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Cxn/HTTP.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Cxn/HTTP.pm
# once (11µs+26µs) by Search::Elasticsearch::Transport::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Transport.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Transport.pm
# once (10µs+26µs) by Search::Elasticsearch::Role::Serializer::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Serializer.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Serializer.pm
# once (10µs+26µs) by Search::Elasticsearch::Role::API::2_0::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/API/2_0.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/API/2_0.pm
# once (10µs+26µs) by Method::Generate::BuildAll::BEGIN@3 at line 3 of Method/Generate/BuildAll.pm
# once (11µs+26µs) by Moo::Role::BEGIN@3 at line 3 of Moo/Role.pm
# once (11µs+26µs) by Search::Elasticsearch::Client::2_0::Direct::Indices::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Client/2_0/Direct/Indices.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Client/2_0/Direct/Indices.pm
# once (11µs+26µs) by Search::Elasticsearch::CxnPool::Static::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/CxnPool/Static.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/CxnPool/Static.pm
# once (10µs+26µs) by Search::Elasticsearch::Role::Logger::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Logger.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Logger.pm
# once (10µs+26µs) by Search::Elasticsearch::Role::Client::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client.pm
# once (10µs+26µs) by Search::Elasticsearch::Role::Transport::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Transport.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Transport.pm
# once (10µs+26µs) by Method::Generate::Accessor::BEGIN@3 at line 3 of Method/Generate/Accessor.pm
# once (10µs+26µs) by Search::Elasticsearch::Util::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Util.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Util.pm
# once (10µs+25µs) by Moo::sification::BEGIN@3 at line 3 of Moo/sification.pm
# once (10µs+25µs) by Search::Elasticsearch::Role::Bulk::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Bulk.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Bulk.pm
# once (10µs+25µs) by Search::Elasticsearch::Role::Cxn::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Cxn.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Cxn.pm
# once (10µs+25µs) by Search::Elasticsearch::Role::CxnPool::Static::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/CxnPool/Static.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/CxnPool/Static.pm
# once (11µs+25µs) by Search::Elasticsearch::Role::CxnPool::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/CxnPool.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/CxnPool.pm
# once (10µs+25µs) by Search::Elasticsearch::Client::2_0::Direct::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Client/2_0/Direct.pm:5] at line 5 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Client/2_0/Direct.pm
# once (10µs+25µs) by Search::Elasticsearch::Role::Is_Sync::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Is_Sync.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Is_Sync.pm
# once (10µs+25µs) by Moo::HandleMoose::_TypeMap::BEGIN@2 at line 2 of Moo/HandleMoose/_TypeMap.pm
# once (10µs+25µs) by Search::Elasticsearch::Logger::LogAny::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Logger/LogAny.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Logger/LogAny.pm
# once (10µs+25µs) by Search::Elasticsearch::Cxn::Factory::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Cxn/Factory.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Cxn/Factory.pm
# once (10µs+25µs) by Method::Generate::Constructor::BEGIN@3 at line 3 of Method/Generate/Constructor.pm
# once (10µs+25µs) by Sub::Defer::BEGIN@3 at line 3 of Sub/Defer.pm
# once (10µs+25µs) by Sub::Quote::BEGIN@3 at line 3 of Sub/Quote.pm
# once (10µs+25µs) by Search::Elasticsearch::Role::Client::Direct::Main::__ANON__[/opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client/Direct/Main.pm:3] at line 3 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client/Direct/Main.pm
# once (10µs+25µs) by Moo::Object::BEGIN@3 at line 3 of Moo/Object.pm
# once (10µs+24µs) by Moo::_Utils::BEGIN@11 at line 11 of Moo/_Utils.pm | ||||
33 | 36 | 49µs | 36 | 427µs | strict->import; # spent 427µs making 36 calls to strict::import, avg 12µs/call |
34 | 36 | 58µs | 36 | 469µs | warnings->import(FATAL => 'all'); # spent 469µs making 36 calls to warnings::import, avg 13µs/call |
35 | |||||
36 | 36 | 24µs | my $extra_tests = do { | ||
37 | 36 | 27µs | if (exists $ENV{PERL_STRICTURES_EXTRA}) { | ||
38 | if (_PERL_LT_5_8_4 and $ENV{PERL_STRICTURES_EXTRA}) { | ||||
39 | die 'PERL_STRICTURES_EXTRA checks are not available on perls older than 5.8.4: ' | ||||
40 | . "please unset \$ENV{PERL_STRICTURES_EXTRA}\n"; | ||||
41 | } | ||||
42 | $ENV{PERL_STRICTURES_EXTRA}; | ||||
43 | } elsif (! _PERL_LT_5_8_4) { | ||||
44 | 36 | 179µs | 36 | 51µs | !!((caller)[1] =~ /^(?:t|xt|lib|blib)/ # spent 51µs making 36 calls to strictures::CORE:match, avg 1µs/call |
45 | and $Smells_Like_VCS) | ||||
46 | } | ||||
47 | }; | ||||
48 | 36 | 146µs | if ($extra_tests) { | ||
49 | $extra_load_states ||= do { | ||||
50 | |||||
51 | my (%rv, @failed); | ||||
52 | foreach my $mod (qw(indirect multidimensional bareword::filehandles)) { | ||||
53 | eval "require $mod; \$rv{'$mod'} = 1;" or do { | ||||
54 | push @failed, $mod; | ||||
55 | |||||
56 | # courtesy of the 5.8 require bug | ||||
57 | # (we do a copy because 5.16.2 at least uses the same read-only | ||||
58 | # scalars for the qw() list and it doesn't seem worth a $^V check) | ||||
59 | |||||
60 | (my $file = $mod) =~ s|::|/|g; | ||||
61 | delete $INC{"${file}.pm"}; | ||||
62 | }; | ||||
63 | } | ||||
64 | |||||
65 | if (@failed) { | ||||
66 | my $failed = join ' ', @failed; | ||||
67 | print STDERR <<EOE; | ||||
68 | strictures.pm extra testing active but couldn't load all modules. Missing were: | ||||
69 | |||||
70 | $failed | ||||
71 | |||||
72 | Extra testing is auto-enabled in checkouts only, so if you're the author | ||||
73 | of a strictures-using module you need to run: | ||||
74 | |||||
75 | cpan indirect multidimensional bareword::filehandles | ||||
76 | |||||
77 | but these modules are not required by your users. | ||||
78 | EOE | ||||
79 | } | ||||
80 | |||||
81 | \%rv; | ||||
82 | }; | ||||
83 | |||||
84 | indirect->unimport(':fatal') if $extra_load_states->{indirect}; | ||||
85 | multidimensional->unimport if $extra_load_states->{multidimensional}; | ||||
86 | bareword::filehandles->unimport if $extra_load_states->{'bareword::filehandles'}; | ||||
87 | } | ||||
88 | } | ||||
89 | |||||
90 | 1 | 5µs | 1; | ||
91 | |||||
92 | __END__ | ||||
# spent 7µs within strictures::CORE:ftis which was called 4 times, avg 2µs/call:
# 4 times (7µs+0s) by Moo::BEGIN@3 at line 28, avg 2µs/call | |||||
# spent 51µs within strictures::CORE:match which was called 36 times, avg 1µs/call:
# 36 times (51µs+0s) by strictures::import at line 44, avg 1µs/call |