Filename | /var/www/foswikidev/core/lib/Foswiki/Search/Node.pm |
Statements | Executed 370 statements in 1.14ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
40 | 1 | 1 | 307µs | 307µs | new | Foswiki::Search::Node::
40 | 1 | 1 | 150µs | 150µs | isEmpty | Foswiki::Search::Node::
40 | 1 | 1 | 120µs | 120µs | tokens | Foswiki::Search::Node::
40 | 1 | 1 | 108µs | 108µs | simplify | Foswiki::Search::Node::
1 | 1 | 1 | 14µs | 31µs | BEGIN@12 | Foswiki::Search::Node::
1 | 1 | 1 | 11µs | 34µs | BEGIN@15 | Foswiki::Search::Node::
1 | 1 | 1 | 10µs | 14µs | BEGIN@13 | Foswiki::Search::Node::
1 | 1 | 1 | 8µs | 121µs | BEGIN@16 | Foswiki::Search::Node::
1 | 1 | 1 | 4µs | 4µs | BEGIN@18 | Foswiki::Search::Node::
0 | 0 | 0 | 0s | 0s | stringify | Foswiki::Search::Node::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | package Foswiki::Search::Node; | ||||
3 | |||||
4 | =begin TML | ||||
5 | |||||
6 | ---+ package Foswiki::Search | ||||
7 | |||||
8 | Refactoring mid-step that contains a set of SEARCH tokens and options. | ||||
9 | |||||
10 | =cut | ||||
11 | |||||
12 | 2 | 27µs | 2 | 48µs | # spent 31µs (14+17) within Foswiki::Search::Node::BEGIN@12 which was called:
# once (14µs+17µs) by Foswiki::Store::Interfaces::QueryAlgorithm::BEGIN@9 at line 12 # spent 31µs making 1 call to Foswiki::Search::Node::BEGIN@12
# spent 17µs making 1 call to strict::import |
13 | 2 | 25µs | 2 | 17µs | # spent 14µs (10+4) within Foswiki::Search::Node::BEGIN@13 which was called:
# once (10µs+4µs) by Foswiki::Store::Interfaces::QueryAlgorithm::BEGIN@9 at line 13 # spent 14µs making 1 call to Foswiki::Search::Node::BEGIN@13
# spent 4µs making 1 call to warnings::import |
14 | |||||
15 | 2 | 27µs | 2 | 58µs | # spent 34µs (11+24) within Foswiki::Search::Node::BEGIN@15 which was called:
# once (11µs+24µs) by Foswiki::Store::Interfaces::QueryAlgorithm::BEGIN@9 at line 15 # spent 34µs making 1 call to Foswiki::Search::Node::BEGIN@15
# spent 24µs making 1 call to Exporter::import |
16 | 2 | 50µs | 2 | 233µs | # spent 121µs (8+112) within Foswiki::Search::Node::BEGIN@16 which was called:
# once (8µs+112µs) by Foswiki::Store::Interfaces::QueryAlgorithm::BEGIN@9 at line 16 # spent 121µs making 1 call to Foswiki::Search::Node::BEGIN@16
# spent 112µs making 1 call to Error::import |
17 | |||||
18 | # spent 4µs within Foswiki::Search::Node::BEGIN@18 which was called:
# once (4µs+0s) by Foswiki::Store::Interfaces::QueryAlgorithm::BEGIN@9 at line 23 | ||||
19 | 1 | 4µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
20 | require locale; | ||||
21 | import locale(); | ||||
22 | } | ||||
23 | 1 | 224µs | 1 | 4µs | } # spent 4µs making 1 call to Foswiki::Search::Node::BEGIN@18 |
24 | |||||
25 | # Some day this may usefully be an infix node | ||||
26 | #use Foswiki::Infix::Node (); | ||||
27 | #our @ISA = ('Foswiki::Infix::Node'); | ||||
28 | |||||
29 | =begin TML | ||||
30 | |||||
31 | ---++ ClassMethod new($search, $tokens, $options) | ||||
32 | |||||
33 | Construct a search token container. | ||||
34 | |||||
35 | =cut | ||||
36 | |||||
37 | # spent 307µs within Foswiki::Search::Node::new which was called 40 times, avg 8µs/call:
# 40 times (307µs+0s) by Foswiki::Store::QueryAlgorithms::BruteForce::_webQuery at line 158 of /var/www/foswikidev/core/lib/Foswiki/Store/QueryAlgorithms/BruteForce.pm, avg 8µs/call | ||||
38 | 40 | 56µs | my ( $class, $search, $tokens, $options ) = @_; | ||
39 | 40 | 144µs | my $this = bless( | ||
40 | { | ||||
41 | tokens => $tokens, | ||||
42 | search => $search, | ||||
43 | options => $options, | ||||
44 | }, | ||||
45 | $class | ||||
46 | ); | ||||
47 | 40 | 125µs | return $this; | ||
48 | } | ||||
49 | |||||
50 | =begin TML | ||||
51 | |||||
52 | ---++ ObjectMethod tokens() -> \@tokenList | ||||
53 | |||||
54 | Return a ref to a list of tokens that are ANDed to perform the search. | ||||
55 | |||||
56 | =cut | ||||
57 | |||||
58 | # spent 120µs within Foswiki::Search::Node::tokens which was called 40 times, avg 3µs/call:
# 40 times (120µs+0s) by Foswiki::Store::SearchAlgorithms::Forking::_webQuery at line 208 of /var/www/foswikidev/core/lib/Foswiki/Store/SearchAlgorithms/Forking.pm, avg 3µs/call | ||||
59 | 40 | 12µs | my $this = shift; | ||
60 | 40 | 21µs | return [] unless $this->{tokens}; | ||
61 | 40 | 128µs | return $this->{tokens}; | ||
62 | } | ||||
63 | |||||
64 | =begin TML | ||||
65 | |||||
66 | ---++ ObjectMethod isEmpty() -> boolean | ||||
67 | |||||
68 | Return true if this search is empty (has no tokens) | ||||
69 | |||||
70 | =cut | ||||
71 | |||||
72 | # spent 150µs within Foswiki::Search::Node::isEmpty which was called 40 times, avg 4µs/call:
# 40 times (150µs+0s) by Foswiki::Store::Interfaces::QueryAlgorithm::query at line 84 of /var/www/foswikidev/core/lib/Foswiki/Store/Interfaces/QueryAlgorithm.pm, avg 4µs/call | ||||
73 | 40 | 27µs | my $this = shift; | ||
74 | 40 | 167µs | return !( $this->{tokens} && scalar( @{ $this->{tokens} } ) > 0 ); | ||
75 | } | ||||
76 | |||||
77 | sub stringify { | ||||
78 | my $this = shift; | ||||
79 | return | ||||
80 | join( ' ', @{ $this->{tokens} } ) . ' {' | ||||
81 | . join( ',', | ||||
82 | map { "$_=>$this->{options}->{$_}" } | ||||
83 | grep { !/^_/ } keys %{ $this->{options} } ) | ||||
84 | . '}'; | ||||
85 | } | ||||
86 | |||||
87 | =begin TML | ||||
88 | |||||
89 | ---++ ObjectMethod simplify(%opts) | ||||
90 | |||||
91 | does nothing yet | ||||
92 | |||||
93 | =cut | ||||
94 | |||||
95 | 40 | 101µs | # spent 108µs within Foswiki::Search::Node::simplify which was called 40 times, avg 3µs/call:
# 40 times (108µs+0s) by Foswiki::Store::Interfaces::QueryAlgorithm::query at line 98 of /var/www/foswikidev/core/lib/Foswiki/Store/Interfaces/QueryAlgorithm.pm, avg 3µs/call | ||
96 | } | ||||
97 | |||||
98 | 1 | 2µs | 1; | ||
99 | __END__ |