| Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Object.pm |
| Statements | Executed 1292 statements in 6.06ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 11 | 1 | 1 | 2.96ms | 103ms | Path::IsDev::Object::_with_debug |
| 1 | 1 | 1 | 1.21ms | 6.01ms | Path::IsDev::Object::__ANON__[:74] |
| 340 | 2 | 2 | 1.08ms | 1.49ms | Path::IsDev::Object::__ANON__[:156] |
| 11 | 1 | 1 | 602µs | 105ms | Path::IsDev::Object::_matches |
| 11 | 1 | 1 | 586µs | 106ms | Path::IsDev::Object::matches |
| 362 | 3 | 1 | 440µs | 440µs | Path::IsDev::Object::_debug |
| 11 | 1 | 1 | 327µs | 100ms | Path::IsDev::Object::__ANON__[:201] |
| 1 | 1 | 1 | 16µs | 382µs | Path::IsDev::Object::BEGIN@64 |
| 1 | 1 | 1 | 15µs | 15µs | Path::FindDev::Object::BEGIN@1 |
| 1 | 1 | 1 | 14µs | 127µs | Path::IsDev::Object::__ANON__[:70] |
| 1 | 1 | 1 | 8µs | 18µs | Path::IsDev::Object::BEGIN@153 |
| 1 | 1 | 1 | 7µs | 18µs | Path::FindDev::Object::BEGIN@2 |
| 1 | 1 | 1 | 7µs | 10µs | Path::FindDev::Object::BEGIN@3 |
| 1 | 1 | 1 | 7µs | 8µs | Path::FindDev::Object::BEGIN@4 |
| 1 | 1 | 1 | 2µs | 2µs | Path::IsDev::Object::BUILD |
| 1 | 1 | 1 | 1µs | 1µs | Path::IsDev::Object::__ANON__[:65] |
| 1 | 1 | 1 | 1µs | 1µs | Path::IsDev::Object::__ANON__[:66] |
| 0 | 0 | 0 | 0s | 0s | Path::IsDev::Object::_carp |
| 0 | 0 | 0 | 0s | 0s | Path::IsDev::Object::_instance_id |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 2 | 39µs | 1 | 15µ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 # spent 15µs making 1 call to Path::FindDev::Object::BEGIN@1 |
| 2 | 2 | 20µs | 2 | 30µ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 # spent 18µs making 1 call to Path::FindDev::Object::BEGIN@2
# spent 11µs making 1 call to strict::import |
| 3 | 2 | 21µs | 2 | 14µ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 # spent 10µs making 1 call to Path::FindDev::Object::BEGIN@3
# spent 4µs making 1 call to warnings::import |
| 4 | 2 | 206µs | 2 | 9µ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 # spent 8µs making 1 call to Path::FindDev::Object::BEGIN@4
# spent 1µs making 1 call to utf8::import |
| 5 | |||||
| 6 | package Path::IsDev::Object; | ||||
| 7 | 1 | 600ns | $Path::IsDev::Object::VERSION = '1.001000'; | ||
| 8 | # ABSTRACT: Object Oriented guts for IsDev export | ||||
| 9 | |||||
| 10 | 1 | 200ns | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | ||
| 11 | |||||
| - - | |||||
| 49 | 1 | 100ns | our $ENV_KEY_DEBUG = 'PATH_ISDEV_DEBUG'; | ||
| 50 | 1 | 700ns | our $DEBUG = ( exists $ENV{$ENV_KEY_DEBUG} ? $ENV{$ENV_KEY_DEBUG} : undef ); | ||
| 51 | |||||
| 52 | 1 | 200ns | our $ENV_KEY_DEFAULT = 'PATH_ISDEV_DEFAULT_SET'; | ||
| 53 | 1 | 400ns | our $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 | ||||
| 65 | 1 | 3µ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] | ||
| 66 | 1 | 4µ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] | ||
| 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] | ||||
| 68 | 1 | 300ns | require Module::Runtime; | ||
| 69 | 1 | 6µs | 3 | 112µ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] | ||||
| 72 | 1 | 99µs | require Module::Runtime; | ||
| 73 | 1 | 7µs | 2 | 4.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 | }, | ||||
| 75 | 3 | 200µs | 3 | 748µ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 | |||||
| - - | |||||
| 95 | 1 | 500ns | my $instances = {}; | ||
| 96 | 1 | 100ns | my $instance_id = 0; | ||
| 97 | |||||
| 98 | sub _carp { require Carp; goto &Carp::carp; } | ||||
| 99 | |||||
| - - | |||||
| 111 | sub _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 | ||||
| 131 | 362 | 111µs | my ( $self, $message ) = @_; | ||
| 132 | |||||
| 133 | 362 | 708µ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 | ||||
| 150 | 11 | 3µs | my ( $self, $code ) = @_; | ||
| 151 | 11 | 3µs | require Path::IsDev; | ||
| 152 | ## no critic (ProhibitNoWarnings) | ||||
| 153 | 2 | 272µs | 2 | 29µ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 # 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 | ||||
| 155 | 340 | 839µs | 340 | 412µs | $self->_debug(@_); # spent 412µs making 340 calls to Path::IsDev::Object::_debug, avg 1µs/call |
| 156 | 11 | 18µs | }; | ||
| 157 | 11 | 55µs | 11 | 100ms | 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 | ||||
| 170 | 1 | 200ns | my ($self) = @_; | ||
| 171 | 1 | 3µ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 | ||||
| 192 | 11 | 2µs | my ( $self, $path ) = @_; | ||
| 193 | 11 | 59µs | require Path::IsDev::Result; | ||
| 194 | 11 | 38µs | 11 | 900µ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 |
| 195 | 11 | 300ns | 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 | ||||
| 198 | |||||
| 199 | 11 | 211µs | 33 | 42µ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 |
| 200 | 11 | 2.92ms | 22 | 99.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 | }, | ||||
| 202 | 11 | 55µs | 11 | 103ms | ); # spent 103ms making 11 calls to Path::IsDev::Object::_with_debug, avg 9.38ms/call |
| 203 | 11 | 21µs | 11 | 20µ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 | } | ||||
| 206 | 11 | 33µ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 | ||||
| 220 | 11 | 3µs | my ( $self, $path ) = @_; | ||
| 221 | |||||
| 222 | 11 | 14µs | 11 | 105ms | my $result_object = $self->_matches($path); # spent 105ms making 11 calls to Path::IsDev::Object::_matches, avg 9.54ms/call |
| 223 | |||||
| 224 | 11 | 15µs | 11 | 12µs | if ( not $result_object->result ) { # spent 12µs making 11 calls to Path::IsDev::Result::result, avg 1µs/call |
| 225 | 11 | 11µs | 11 | 14µs | $self->_debug('no match found'); # spent 14µs making 11 calls to Path::IsDev::Object::_debug, avg 1µs/call |
| 226 | 11 | 46µs | return; | ||
| 227 | } | ||||
| 228 | |||||
| 229 | return $result_object->result; | ||||
| 230 | } | ||||
| 231 | |||||
| 232 | 1 | 4µs | 1; | ||
| 233 | |||||
| 234 | __END__ |