Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Role/Matcher/Child/Exists/Any.pm |
Statements | Executed 1109 statements in 2.73ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
137 | 2 | 2 | 2.33ms | 12.6ms | child_exists | Path::IsDev::Role::Matcher::Child::Exists::Any::
137 | 1 | 1 | 753µs | 912µs | CORE:ftis (opcode) | Path::IsDev::Role::Matcher::Child::Exists::Any::
1 | 1 | 1 | 16µs | 16µs | BEGIN@1.33 | Role::Tiny::
1 | 1 | 1 | 7µs | 93µs | BEGIN@12 | Path::IsDev::Role::Matcher::Child::Exists::Any::
1 | 1 | 1 | 7µs | 11µs | BEGIN@3.35 | Role::Tiny::
1 | 1 | 1 | 7µs | 8µs | BEGIN@4.36 | Role::Tiny::
1 | 1 | 1 | 7µs | 18µs | BEGIN@2.34 | Role::Tiny::
0 | 0 | 0 | 0s | 0s | child_exists_any | Path::IsDev::Role::Matcher::Child::Exists::Any::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 42µs | 1 | 16µs | # spent 16µs within Role::Tiny::BEGIN@1.33 which was called:
# once (16µs+0s) by Role::Tiny::_load_module at line 1 # spent 16µs making 1 call to Role::Tiny::BEGIN@1.33 |
2 | 2 | 20µs | 2 | 30µs | # spent 18µs (7+12) within Role::Tiny::BEGIN@2.34 which was called:
# once (7µs+12µs) by Role::Tiny::_load_module at line 2 # spent 18µs making 1 call to Role::Tiny::BEGIN@2.34
# spent 12µs making 1 call to strict::import |
3 | 2 | 19µs | 2 | 15µs | # spent 11µs (7+4) within Role::Tiny::BEGIN@3.35 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.35
# spent 4µs making 1 call to warnings::import |
4 | 2 | 52µs | 2 | 10µs | # spent 8µs (7+2) within Role::Tiny::BEGIN@4.36 which was called:
# once (7µs+2µs) by Role::Tiny::_load_module at line 4 # spent 8µs making 1 call to Role::Tiny::BEGIN@4.36
# spent 2µs making 1 call to utf8::import |
5 | |||||
6 | package Path::IsDev::Role::Matcher::Child::Exists::Any; | ||||
7 | 1 | 600ns | $Path::IsDev::Role::Matcher::Child::Exists::Any::VERSION = '1.001000'; | ||
8 | # ABSTRACT: Match if any of a list of children exists | ||||
9 | |||||
10 | 1 | 200ns | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | ||
11 | |||||
12 | 2 | 184µs | 2 | 179µs | # spent 93µs (7+86) within Path::IsDev::Role::Matcher::Child::Exists::Any::BEGIN@12 which was called:
# once (7µs+86µs) by Role::Tiny::_load_module at line 12 # spent 93µs making 1 call to Path::IsDev::Role::Matcher::Child::Exists::Any::BEGIN@12
# spent 86µs making 1 call to Role::Tiny::import |
13 | |||||
- - | |||||
33 | # spent 12.6ms (2.33+10.3) within Path::IsDev::Role::Matcher::Child::Exists::Any::child_exists which was called 137 times, avg 92µs/call:
# 110 times (1.87ms+8.21ms) by Path::IsDev::Role::Matcher::Child::Exists::Any::File::child_exists_any_file at line 66 of Path/IsDev/Role/Matcher/Child/Exists/Any/File.pm, avg 92µs/call
# 27 times (465µs+2.05ms) by Path::IsDev::Role::Matcher::Child::Exists::Any::Dir::child_exists_any_dir at line 64 of Path/IsDev/Role/Matcher/Child/Exists/Any/Dir.pm, avg 93µs/call | ||||
34 | 137 | 35µs | my ( $self, $result_object, $child ) = @_; | ||
35 | |||||
36 | 137 | 278µs | 274 | 3.28ms | my $child_path = $result_object->path->child($child); # spent 3.11ms making 137 calls to Path::Tiny::child, avg 23µs/call
# spent 170µs making 137 calls to Path::IsDev::Result::path, avg 1µs/call |
37 | |||||
38 | 137 | 423µs | 137 | 198µs | my $ctx = { 'child_name' => $child, child_path => "$child_path", tests => [] }; # spent 198µs making 137 calls to Path::Tiny::__ANON__[Path/Tiny.pm:31], avg 1µs/call |
39 | 137 | 32µs | my $tests = $ctx->{tests}; | ||
40 | |||||
41 | 137 | 874µs | 274 | 1.07ms | if ( -e $child_path ) { # spent 912µs making 137 calls to Path::IsDev::Role::Matcher::Child::Exists::Any::CORE:ftis, avg 7µs/call
# spent 159µs making 137 calls to Path::Tiny::__ANON__[Path/Tiny.pm:31], avg 1µs/call |
42 | push @{$tests}, { 'child_path_exists?' => 1 }; | ||||
43 | $result_object->add_reason( $self, 1, "$child exists", $ctx ); | ||||
44 | return 1; | ||||
45 | } | ||||
46 | 137 | 148µs | push @{$tests}, { 'child_path_exists?' => 0 }; | ||
47 | 137 | 179µs | 137 | 5.87ms | $result_object->add_reason( $self, 0, "$child does not exist", $ctx ); # spent 5.87ms making 137 calls to Path::IsDev::Result::add_reason, avg 43µs/call |
48 | 137 | 441µs | return; | ||
49 | } | ||||
50 | |||||
- - | |||||
59 | sub child_exists_any { | ||||
60 | my ( $self, $result_object, @children ) = @_; | ||||
61 | for my $child (@children) { | ||||
62 | return 1 if $self->child_exists( $result_object, $child ); | ||||
63 | } | ||||
64 | return; | ||||
65 | } | ||||
66 | |||||
67 | 1 | 3µs | 1; | ||
68 | |||||
69 | __END__ | ||||
# spent 912µs (753+159) within Path::IsDev::Role::Matcher::Child::Exists::Any::CORE:ftis which was called 137 times, avg 7µs/call:
# 137 times (753µs+159µs) by Path::IsDev::Role::Matcher::Child::Exists::Any::child_exists at line 41, avg 7µs/call |