| Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Role/Matcher/Child/BaseName/MatchRegexp.pm |
| Statements | Executed 783 statements in 2.26ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 110 | 1 | 1 | 2.32ms | 10.1ms | Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::_this_child_matchregexp |
| 110 | 1 | 1 | 137µs | 137µs | Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::CORE:regcomp (opcode) |
| 110 | 1 | 1 | 59µs | 59µs | Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::CORE:match (opcode) |
| 1 | 1 | 1 | 15µs | 15µs | Role::Tiny::BEGIN@1.77 |
| 1 | 1 | 1 | 10µs | 82µs | Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::BEGIN@23 |
| 1 | 1 | 1 | 7µs | 11µs | Role::Tiny::BEGIN@3.79 |
| 1 | 1 | 1 | 6µs | 8µs | Role::Tiny::BEGIN@4.80 |
| 1 | 1 | 1 | 6µs | 17µs | Role::Tiny::BEGIN@2.78 |
| 0 | 0 | 0 | 0s | 0s | Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::child_basename_matchregexp |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 2 | 35µs | 1 | 15µs | # spent 15µs within Role::Tiny::BEGIN@1.77 which was called:
# once (15µs+0s) by Role::Tiny::_load_module at line 1 # spent 15µs making 1 call to Role::Tiny::BEGIN@1.77 |
| 2 | 2 | 21µs | 2 | 29µs | # spent 17µs (6+11) within Role::Tiny::BEGIN@2.78 which was called:
# once (6µs+11µs) by Role::Tiny::_load_module at line 2 # spent 17µs making 1 call to Role::Tiny::BEGIN@2.78
# spent 11µs making 1 call to strict::import |
| 3 | 2 | 18µs | 2 | 14µs | # spent 11µs (7+4) within Role::Tiny::BEGIN@3.79 which was called:
# once (7µs+4µs) by Role::Tiny::_load_module at line 3 # spent 11µs making 1 call to Role::Tiny::BEGIN@3.79
# spent 4µs making 1 call to warnings::import |
| 4 | 2 | 56µs | 2 | 9µs | # spent 8µs (6+1) within Role::Tiny::BEGIN@4.80 which was called:
# once (6µs+1µs) by Role::Tiny::_load_module at line 4 # spent 8µs making 1 call to Role::Tiny::BEGIN@4.80
# spent 1µs making 1 call to utf8::import |
| 5 | |||||
| 6 | package Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp; | ||||
| 7 | 1 | 600ns | $Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::VERSION = '1.001000'; | ||
| 8 | # ABSTRACT: Match when a path has a child file matching an expression | ||||
| 9 | |||||
| 10 | 1 | 200ns | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | ||
| 11 | |||||
| - - | |||||
| 23 | 2 | 182µs | 2 | 153µs | # spent 82µs (10+71) within Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::BEGIN@23 which was called:
# once (10µs+71µs) by Role::Tiny::_load_module at line 23 # spent 82µs making 1 call to Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::BEGIN@23
# spent 71µs making 1 call to Role::Tiny::import |
| 24 | |||||
| - - | |||||
| 33 | # spent 10.1ms (2.32+7.82) within Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::_this_child_matchregexp which was called 110 times, avg 92µs/call:
# 110 times (2.32ms+7.82ms) by Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::File::child_basename_matchregexp_file at line 71 of Path/IsDev/Role/Matcher/Child/BaseName/MatchRegexp/File.pm, avg 92µs/call | ||||
| 34 | 110 | 37µs | my ( $self, $result_object, $child, $regexp ) = @_; | ||
| 35 | 110 | 423µs | 220 | 2.24ms | my $ctx = { # spent 2.08ms making 110 calls to Path::Tiny::basename, avg 19µs/call
# spent 152µs making 110 calls to Path::Tiny::__ANON__[Path/Tiny.pm:31], avg 1µs/call |
| 36 | 'child' => "$child", | ||||
| 37 | 'child_basename' => $child->basename, | ||||
| 38 | expression => $regexp, | ||||
| 39 | tests => [], | ||||
| 40 | }; | ||||
| 41 | 110 | 28µs | my $tests = $ctx->{tests}; | ||
| 42 | |||||
| 43 | 110 | 730µs | 330 | 484µs | if ( $child->basename =~ $regexp ) { # spent 288µs making 110 calls to Path::Tiny::basename, avg 3µs/call
# spent 137µs making 110 calls to Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::CORE:regcomp, avg 1µs/call
# spent 59µs making 110 calls to Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::CORE:match, avg 537ns/call |
| 44 | push @{$tests}, { 'child_basename_matches_expression?' => 1 }; | ||||
| 45 | $result_object->add_reason( $self, 1, $child->basename . " matches $regexp", $ctx ); | ||||
| 46 | return 1; | ||||
| 47 | } | ||||
| 48 | 110 | 118µs | push @{$tests}, { 'child_basename_matches_expression?' => 0 }; | ||
| 49 | 110 | 288µs | 220 | 5.10ms | $result_object->add_reason( $self, 0, $child->basename . " does not match $regexp", $ctx ); # spent 4.80ms making 110 calls to Path::IsDev::Result::add_reason, avg 44µs/call
# spent 298µs making 110 calls to Path::Tiny::basename, avg 3µs/call |
| 50 | 110 | 318µs | return; | ||
| 51 | } | ||||
| 52 | |||||
| - - | |||||
| 65 | sub child_basename_matchregexp { | ||||
| 66 | my ( $self, $result_object, $regexp ) = @_; | ||||
| 67 | for my $child ( $result_object->path->children ) { | ||||
| 68 | return 1 if $self->_this_child_matchregexp( $result_object, $child, $regexp ); | ||||
| 69 | } | ||||
| 70 | return; | ||||
| 71 | } | ||||
| 72 | |||||
| 73 | 1 | 2µs | 1; | ||
| 74 | |||||
| 75 | __END__ | ||||
# spent 59µs within Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::CORE:match which was called 110 times, avg 537ns/call:
# 110 times (59µs+0s) by Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::_this_child_matchregexp at line 43, avg 537ns/call | |||||
# spent 137µs within Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::CORE:regcomp which was called 110 times, avg 1µs/call:
# 110 times (137µs+0s) by Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::_this_child_matchregexp at line 43, avg 1µs/call |