Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Path/IsDev/Role/Matcher/Child/Exists/Any/Dir.pm |
Statements | Executed 95 statements in 631µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
18 | 2 | 2 | 133µs | 2.65ms | child_exists_any_dir | Path::IsDev::Role::Matcher::Child::Exists::Any::Dir::
1 | 1 | 1 | 24µs | 24µs | BEGIN@1.85 | Role::Tiny::
1 | 1 | 1 | 17µs | 138µs | BEGIN@24 | Path::IsDev::Role::Matcher::Child::Exists::Any::Dir::
1 | 1 | 1 | 11µs | 14µs | BEGIN@4.88 | Role::Tiny::
1 | 1 | 1 | 11µs | 17µs | BEGIN@3.87 | Role::Tiny::
1 | 1 | 1 | 10µs | 28µs | BEGIN@2.86 | Role::Tiny::
0 | 0 | 0 | 0s | 0s | child_exists_dir | Path::IsDev::Role::Matcher::Child::Exists::Any::Dir::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 58µs | 1 | 24µs | # spent 24µs within Role::Tiny::BEGIN@1.85 which was called:
# once (24µs+0s) by Role::Tiny::_load_module at line 1 # spent 24µs making 1 call to Role::Tiny::BEGIN@1.85 |
2 | 2 | 30µs | 2 | 46µs | # spent 28µs (10+18) within Role::Tiny::BEGIN@2.86 which was called:
# once (10µs+18µs) by Role::Tiny::_load_module at line 2 # spent 28µs making 1 call to Role::Tiny::BEGIN@2.86
# spent 18µs making 1 call to strict::import |
3 | 2 | 34µs | 2 | 23µs | # spent 17µs (11+6) within Role::Tiny::BEGIN@3.87 which was called:
# once (11µs+6µs) by Role::Tiny::_load_module at line 3 # spent 17µs making 1 call to Role::Tiny::BEGIN@3.87
# spent 6µs making 1 call to warnings::import |
4 | 2 | 84µs | 2 | 16µs | # spent 14µs (11+2) within Role::Tiny::BEGIN@4.88 which was called:
# once (11µs+2µs) by Role::Tiny::_load_module at line 4 # spent 14µs making 1 call to Role::Tiny::BEGIN@4.88
# spent 2µs making 1 call to utf8::import |
5 | |||||
6 | package Path::IsDev::Role::Matcher::Child::Exists::Any::Dir; | ||||
7 | 1 | 900ns | $Path::IsDev::Role::Matcher::Child::Exists::Any::Dir::VERSION = '1.001000'; | ||
8 | # ABSTRACT: Match if a path contains one of any of a list of directories | ||||
9 | |||||
10 | 1 | 300ns | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | ||
11 | |||||
- - | |||||
24 | 2 | 306µs | 2 | 259µs | # spent 138µs (17+121) within Path::IsDev::Role::Matcher::Child::Exists::Any::Dir::BEGIN@24 which was called:
# once (17µs+121µs) by Role::Tiny::_load_module at line 24 # spent 138µs making 1 call to Path::IsDev::Role::Matcher::Child::Exists::Any::Dir::BEGIN@24
# spent 121µs making 1 call to Role::Tiny::import |
25 | 1 | 3µs | 1 | 174µs | with 'Path::IsDev::Role::Matcher::Child::Exists::Any'; # spent 174µs making 1 call to Role::Tiny::__ANON__[Role/Tiny.pm:67] |
26 | |||||
- - | |||||
35 | sub child_exists_dir { | ||||
36 | my ( $self, $result_object, $child ) = @_; | ||||
37 | |||||
38 | my $child_path = $result_object->path->child($child); | ||||
39 | my $ctx = { 'child_name' => $child, child_path => "$child_path", tests => [] }; | ||||
40 | my $tests = $ctx->{tests}; | ||||
41 | |||||
42 | if ( -d $child_path ) { | ||||
43 | push @{$tests}, { 'child_path_isdir?' => 1 }; | ||||
44 | $result_object->add_reason( $self, 1, "$child_path is a dir", $ctx ); | ||||
45 | return 1; | ||||
46 | } | ||||
47 | push @{$tests}, { 'child_path_isdir?' => 0 }; | ||||
48 | $result_object->add_reason( $self, 0, "$child_path is not a dir", $ctx ); | ||||
49 | |||||
50 | return; | ||||
51 | } | ||||
52 | |||||
- - | |||||
61 | # spent 2.65ms (133µs+2.52) within Path::IsDev::Role::Matcher::Child::Exists::Any::Dir::child_exists_any_dir which was called 18 times, avg 147µs/call:
# 9 times (82µs+1.68ms) by Path::IsDev::Heuristic::TestDir::matches at line 54 of Path/IsDev/Heuristic/TestDir.pm, avg 196µs/call
# 9 times (50µs+839µs) by Path::IsDev::Heuristic::VCS::Git::matches at line 49 of Path/IsDev/Heuristic/VCS/Git.pm, avg 99µs/call | ||||
62 | 18 | 14µs | my ( $self, $result_object, @children ) = @_; | ||
63 | 18 | 8µs | for my $child (@children) { | ||
64 | 27 | 46µs | 27 | 2.52ms | return 1 if $self->child_exists( $result_object, $child ) and $self->child_exists_dir( $result_object, $child ); # spent 2.52ms making 27 calls to Path::IsDev::Role::Matcher::Child::Exists::Any::child_exists, avg 93µs/call |
65 | } | ||||
66 | 18 | 41µs | return; | ||
67 | } | ||||
68 | |||||
69 | 1 | 6µs | 1; | ||
70 | |||||
71 | __END__ |