← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:12 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm
StatementsExecuted 1292 statements in 6.06ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11112.96ms103msPath::IsDev::Object::::_with_debug Path::IsDev::Object::_with_debug
1111.21ms6.01msPath::IsDev::Object::::__ANON__[:74] Path::IsDev::Object::__ANON__[:74]
340221.08ms1.49msPath::IsDev::Object::::__ANON__[:156] Path::IsDev::Object::__ANON__[:156]
1111602µs105msPath::IsDev::Object::::_matches Path::IsDev::Object::_matches
1111586µs106msPath::IsDev::Object::::matches Path::IsDev::Object::matches
36231440µs440µsPath::IsDev::Object::::_debug Path::IsDev::Object::_debug
1111327µs100msPath::IsDev::Object::::__ANON__[:201] Path::IsDev::Object::__ANON__[:201]
11116µs382µsPath::IsDev::Object::::BEGIN@64 Path::IsDev::Object::BEGIN@64
11115µs15µsPath::FindDev::Object::::BEGIN@1Path::FindDev::Object::BEGIN@1
11114µs127µsPath::IsDev::Object::::__ANON__[:70] Path::IsDev::Object::__ANON__[:70]
1118µs18µsPath::IsDev::Object::::BEGIN@153 Path::IsDev::Object::BEGIN@153
1117µs18µsPath::FindDev::Object::::BEGIN@2Path::FindDev::Object::BEGIN@2
1117µs10µsPath::FindDev::Object::::BEGIN@3Path::FindDev::Object::BEGIN@3
1117µs8µsPath::FindDev::Object::::BEGIN@4Path::FindDev::Object::BEGIN@4
1112µs2µsPath::IsDev::Object::::BUILD Path::IsDev::Object::BUILD
1111µs1µsPath::IsDev::Object::::__ANON__[:65] Path::IsDev::Object::__ANON__[:65]
1111µs1µsPath::IsDev::Object::::__ANON__[:66] Path::IsDev::Object::__ANON__[:66]
0000s0sPath::IsDev::Object::::_carp Path::IsDev::Object::_carp
0000s0sPath::IsDev::Object::::_instance_id Path::IsDev::Object::_instance_id
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1239µs115µs
# spent 15µs within Path::FindDev::Object::BEGIN@1 which was called: # once (15µs+0s) by Path::FindDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/FindDev/Object.pm:47] at line 1
use 5.008; # utf8
# spent 15µs making 1 call to Path::FindDev::Object::BEGIN@1
2220µs230µs
# spent 18µs (7+11) within Path::FindDev::Object::BEGIN@2 which was called: # once (7µs+11µs) by Path::FindDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/FindDev/Object.pm:47] at line 2
use strict;
# spent 18µs making 1 call to Path::FindDev::Object::BEGIN@2 # spent 11µs making 1 call to strict::import
3221µs214µs
# spent 10µs (7+4) within Path::FindDev::Object::BEGIN@3 which was called: # once (7µs+4µs) by Path::FindDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/FindDev/Object.pm:47] at line 3
use warnings;
# spent 10µs making 1 call to Path::FindDev::Object::BEGIN@3 # spent 4µs making 1 call to warnings::import
42206µs29µs
# spent 8µs (7+1) within Path::FindDev::Object::BEGIN@4 which was called: # once (7µs+1µs) by Path::FindDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/FindDev/Object.pm:47] at line 4
use utf8;
# spent 8µs making 1 call to Path::FindDev::Object::BEGIN@4 # spent 1µs making 1 call to utf8::import
5
6package Path::IsDev::Object;
71600ns$Path::IsDev::Object::VERSION = '1.001000';
8# ABSTRACT: Object Oriented guts for IsDev export
9
101200nsour $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11
- -
491100nsour $ENV_KEY_DEBUG = 'PATH_ISDEV_DEBUG';
501700nsour $DEBUG = ( exists $ENV{$ENV_KEY_DEBUG} ? $ENV{$ENV_KEY_DEBUG} : undef );
51
521200nsour $ENV_KEY_DEFAULT = 'PATH_ISDEV_DEFAULT_SET';
531400nsour $DEFAULT =
54 ( exists $ENV{$ENV_KEY_DEFAULT} ? $ENV{$ENV_KEY_DEFAULT} : 'Basic' );
55
- -
64
# spent 382µs (16+366) within Path::IsDev::Object::BEGIN@64 which was called: # once (16µs+366µs) by Path::FindDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/FindDev/Object.pm:47] at line 75
use Class::Tiny 0.010 {
6513µs
# spent 1µs within Path::IsDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm:65] which was called: # once (1µs+0s) by Path::IsDev::Object::set at line 1 of (eval 290)[Class/Tiny.pm:56]
set => sub { $DEFAULT },
6614µs
# spent 1µs within Path::IsDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm:66] which was called: # once (1µs+0s) by Path::IsDev::Object::set_prefix at line 1 of (eval 289)[Class/Tiny.pm:56]
set_prefix => sub { 'Path::IsDev::HeuristicSet' },
67
# spent 127µs (14+112) within Path::IsDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm:70] which was called: # once (14µs+112µs) by Path::IsDev::Object::set_module at line 1 of (eval 288)[Class/Tiny.pm:56]
set_module => sub {
681300ns require Module::Runtime;
6916µs3112µs return Module::Runtime::compose_module_name( $_[0]->set_prefix => $_[0]->set );
# spent 98µs making 1 call to Module::Runtime::compose_module_name # spent 8µs making 1 call to Path::IsDev::Object::set_prefix # spent 7µs making 1 call to Path::IsDev::Object::set
70 },
71
# spent 6.01ms (1.21+4.80) within Path::IsDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm:74] which was called: # once (1.21ms+4.80ms) by Path::IsDev::Object::loaded_set_module at line 1 of (eval 291)[Class/Tiny.pm:56]
loaded_set_module => sub {
72199µs require Module::Runtime;
7317µs24.72ms return Module::Runtime::use_module( $_[0]->set_module );
# spent 4.59ms making 1 call to Module::Runtime::use_module # spent 134µs making 1 call to Path::IsDev::Object::set_module
74 },
753200µs3748µs};
# spent 382µs making 1 call to Path::IsDev::Object::BEGIN@64 # spent 358µs making 1 call to Class::Tiny::import # spent 8µs making 1 call to UNIVERSAL::VERSION
76
- -
951500nsmy $instances = {};
961100nsmy $instance_id = 0;
97
98sub _carp { require Carp; goto &Carp::carp; }
99
- -
111sub _instance_id {
112 my ($self) = @_;
113 require Scalar::Util;
114 my $addr = Scalar::Util::refaddr($self);
115 return $instances->{$addr} if exists $instances->{$addr};
116 $instances->{$addr} = sprintf '%x', $instance_id++;
117 return $instances->{$addr};
118}
119
- -
130
# spent 440µs within Path::IsDev::Object::_debug which was called 362 times, avg 1µs/call: # 340 times (412µs+0s) by Path::IsDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm:156] at line 155, avg 1µs/call # 11 times (15µs+0s) by Path::IsDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm:201] at line 199, avg 1µs/call # 11 times (14µs+0s) by Path::IsDev::Object::matches at line 225, avg 1µs/call
sub _debug {
131362111µs my ( $self, $message ) = @_;
132
133362708µs return unless $DEBUG;
134 my $id = $self->_instance_id;
135 return *STDERR->printf( qq{[Path::IsDev=%s] %s\n}, $id, $message );
136}
137
- -
149
# spent 103ms (2.96+100) within Path::IsDev::Object::_with_debug which was called 11 times, avg 9.38ms/call: # 11 times (2.96ms+100ms) by Path::IsDev::Object::_matches at line 202, avg 9.38ms/call
sub _with_debug {
150113µs my ( $self, $code ) = @_;
151113µs require Path::IsDev;
152 ## no critic (ProhibitNoWarnings)
1532272µs229µs
# spent 18µs (8+10) within Path::IsDev::Object::BEGIN@153 which was called: # once (8µs+10µs) by Path::FindDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/FindDev/Object.pm:47] at line 153
no warnings 'redefine';
# spent 18µs making 1 call to Path::IsDev::Object::BEGIN@153 # spent 10µs making 1 call to warnings::unimport
154
# spent 1.49ms (1.08+412µs) within Path::IsDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm:156] which was called 340 times, avg 4µs/call: # 338 times (1.07ms+409µs) by Path::IsDev::Result::add_reason at line 59 of Path/IsDev/Result.pm, avg 4µs/call # 2 times (6µs+2µs) by Path::IsDev::Role::HeuristicSet::matches at line 26 of Path/IsDev/Role/HeuristicSet.pm, avg 4µs/call
local *Path::IsDev::debug = sub {
155340839µs340412µs $self->_debug(@_);
# spent 412µs making 340 calls to Path::IsDev::Object::_debug, avg 1µs/call
1561118µs };
1571155µs11100ms return $code->();
# spent 100ms making 11 calls to Path::IsDev::Object::__ANON__[Path/IsDev/Object.pm:201], avg 9.11ms/call
158}
159
- -
169
# spent 2µs within Path::IsDev::Object::BUILD which was called: # once (2µs+0s) by Class::Tiny::Object::new at line 126 of Class/Tiny.pm
sub BUILD {
1701200ns my ($self) = @_;
17113µs return $self unless $DEBUG;
172 $self->_debug('{');
173 $self->_debug( ' set => ' . $self->set );
174 $self->_debug( ' set_prefix => ' . $self->set_prefix );
175 $self->_debug( ' set_module => ' . $self->set_module );
176 $self->_debug( ' loaded_set_module => ' . $self->loaded_set_module );
177 $self->_debug('}');
178 return $self;
179}
180
- -
191
# spent 105ms (602µs+104) within Path::IsDev::Object::_matches which was called 11 times, avg 9.54ms/call: # 11 times (602µs+104ms) by Path::IsDev::Object::matches at line 222, avg 9.54ms/call
sub _matches {
192112µs my ( $self, $path ) = @_;
1931159µs require Path::IsDev::Result;
1941138µs11900µs my $result_object = Path::IsDev::Result->new( path => $path );
# spent 900µs making 11 calls to Class::Tiny::Object::new, avg 82µs/call
19511300ns my $result;
196 $self->_with_debug(
197
# spent 100ms (327µs+99.9) within Path::IsDev::Object::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm:201] which was called 11 times, avg 9.11ms/call: # 11 times (327µs+99.9ms) by Path::IsDev::Object::_with_debug at line 157, avg 9.11ms/call
sub {
198
19911211µs3342µs $self->_debug( 'Matching ' . $result_object->path );
# spent 15µs making 11 calls to Path::IsDev::Object::_debug, avg 1µs/call # spent 14µs making 11 calls to Path::Tiny::__ANON__[Path/Tiny.pm:31], avg 1µs/call # spent 12µs making 11 calls to Path::IsDev::Result::path, avg 1µs/call
200112.92ms2299.8ms $result = $self->loaded_set_module->matches($result_object);
# spent 93.8ms making 11 calls to Path::IsDev::Role::HeuristicSet::matches, avg 8.53ms/call # spent 6.05ms making 11 calls to Path::IsDev::Object::loaded_set_module, avg 550µs/call
201 },
2021155µs11103ms );
# spent 103ms making 11 calls to Path::IsDev::Object::_with_debug, avg 9.38ms/call
2031121µs1120µs if ( !!$result != !!$result_object->result ) {
# spent 20µs making 11 calls to Path::IsDev::Result::result, avg 2µs/call
204 _carp(q[Result and Result Object missmatch]);
205 }
2061133µs return $result_object;
207}
208
- -
219
# spent 106ms (586µs+105) within Path::IsDev::Object::matches which was called 11 times, avg 9.61ms/call: # 11 times (586µs+105ms) by Path::FindDev::Object::_step at line 200 of Path/FindDev/Object.pm, avg 9.61ms/call
sub matches {
220113µs my ( $self, $path ) = @_;
221
2221114µs11105ms my $result_object = $self->_matches($path);
# spent 105ms making 11 calls to Path::IsDev::Object::_matches, avg 9.54ms/call
223
2241115µs1112µs if ( not $result_object->result ) {
# spent 12µs making 11 calls to Path::IsDev::Result::result, avg 1µs/call
2251111µs1114µs $self->_debug('no match found');
# spent 14µs making 11 calls to Path::IsDev::Object::_debug, avg 1µs/call
2261146µs return;
227 }
228
229 return $result_object->result;
230}
231
23214µs1;
233
234__END__