← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 18:42:36 2015
Reported on Fri Jul 31 18:48:16 2015

Filename/var/www/foswikidev/core/lib/Foswiki/Search/Node.pm
StatementsExecuted 370 statements in 1.14ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
4011307µs307µsFoswiki::Search::Node::::newFoswiki::Search::Node::new
4011150µs150µsFoswiki::Search::Node::::isEmptyFoswiki::Search::Node::isEmpty
4011120µs120µsFoswiki::Search::Node::::tokensFoswiki::Search::Node::tokens
4011108µs108µsFoswiki::Search::Node::::simplifyFoswiki::Search::Node::simplify
11114µs31µsFoswiki::Search::Node::::BEGIN@12Foswiki::Search::Node::BEGIN@12
11111µs34µsFoswiki::Search::Node::::BEGIN@15Foswiki::Search::Node::BEGIN@15
11110µs14µsFoswiki::Search::Node::::BEGIN@13Foswiki::Search::Node::BEGIN@13
1118µs121µsFoswiki::Search::Node::::BEGIN@16Foswiki::Search::Node::BEGIN@16
1114µs4µsFoswiki::Search::Node::::BEGIN@18Foswiki::Search::Node::BEGIN@18
0000s0sFoswiki::Search::Node::::stringifyFoswiki::Search::Node::stringify
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# See bottom of file for license and copyright information
2package Foswiki::Search::Node;
3
4=begin TML
5
6---+ package Foswiki::Search
7
8Refactoring mid-step that contains a set of SEARCH tokens and options.
9
10=cut
11
12227µs248µ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
use strict;
# spent 31µs making 1 call to Foswiki::Search::Node::BEGIN@12 # spent 17µs making 1 call to strict::import
13225µs217µ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
use warnings;
# spent 14µs making 1 call to Foswiki::Search::Node::BEGIN@13 # spent 4µs making 1 call to warnings::import
14
15227µs258µ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
use Assert;
# spent 34µs making 1 call to Foswiki::Search::Node::BEGIN@15 # spent 24µs making 1 call to Exporter::import
16250µs2233µ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
use Error qw( :try );
# 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
BEGIN {
1914µs if ( $Foswiki::cfg{UseLocale} ) {
20 require locale;
21 import locale();
22 }
231224µs14µ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
33Construct 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
sub new {
384056µs my ( $class, $search, $tokens, $options ) = @_;
3940144µs my $this = bless(
40 {
41 tokens => $tokens,
42 search => $search,
43 options => $options,
44 },
45 $class
46 );
4740125µs return $this;
48}
49
50=begin TML
51
52---++ ObjectMethod tokens() -> \@tokenList
53
54Return 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
sub tokens {
594012µs my $this = shift;
604021µs return [] unless $this->{tokens};
6140128µs return $this->{tokens};
62}
63
64=begin TML
65
66---++ ObjectMethod isEmpty() -> boolean
67
68Return 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
sub isEmpty {
734027µs my $this = shift;
7440167µs return !( $this->{tokens} && scalar( @{ $this->{tokens} } ) > 0 );
75}
76
77sub 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
91does nothing yet
92
93=cut
94
9540101µ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
sub simplify {
96}
97
9812µs1;
99__END__