← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/local/src/github.com/foswiki/core/bin/view
  Run on Sun Dec 4 17:17:59 2011
Reported on Sun Dec 4 17:27:23 2011

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Search/Node.pm
StatementsExecuted 9 statements in 564µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11124µs563µsFoswiki::Search::Node::::BEGIN@16Foswiki::Search::Node::BEGIN@16
11124µs31µsFoswiki::Search::Node::::BEGIN@12Foswiki::Search::Node::BEGIN@12
11122µs60µsFoswiki::Search::Node::::BEGIN@15Foswiki::Search::Node::BEGIN@15
11117µs34µsFoswiki::Search::Node::::BEGIN@13Foswiki::Search::Node::BEGIN@13
0000s0sFoswiki::Search::Node::::isEmptyFoswiki::Search::Node::isEmpty
0000s0sFoswiki::Search::Node::::newFoswiki::Search::Node::new
0000s0sFoswiki::Search::Node::::simplifyFoswiki::Search::Node::simplify
0000s0sFoswiki::Search::Node::::stringifyFoswiki::Search::Node::stringify
0000s0sFoswiki::Search::Node::::tokensFoswiki::Search::Node::tokens
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
12244µs238µs
# spent 31µs (24+7) within Foswiki::Search::Node::BEGIN@12 which was called: # once (24µs+7µ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 7µs making 1 call to strict::import
13251µs252µs
# spent 34µs (17+17) within Foswiki::Search::Node::BEGIN@13 which was called: # once (17µs+17µs) by Foswiki::Store::Interfaces::QueryAlgorithm::BEGIN@9 at line 13
use warnings;
# spent 34µs making 1 call to Foswiki::Search::Node::BEGIN@13 # spent 18µs making 1 call to warnings::import
14
15248µs297µs
# spent 60µs (22+38) within Foswiki::Search::Node::BEGIN@15 which was called: # once (22µs+38µs) by Foswiki::Store::Interfaces::QueryAlgorithm::BEGIN@9 at line 15
use Assert;
# spent 60µs making 1 call to Foswiki::Search::Node::BEGIN@15 # spent 38µs making 1 call to Assert::import
162416µs21.10ms
# spent 563µs (24+539) within Foswiki::Search::Node::BEGIN@16 which was called: # once (24µs+539µs) by Foswiki::Store::Interfaces::QueryAlgorithm::BEGIN@9 at line 16
use Error qw( :try );
# spent 563µs making 1 call to Foswiki::Search::Node::BEGIN@16 # spent 539µs making 1 call to Error::import
17
18# Some day this may usefully be an infix node
19#use Foswiki::Infix::Node ();
20#our @ISA = ('Foswiki::Infix::Node');
21
22=begin TML
23
24---++ ClassMethod new($search, $tokens, $options)
25
26Construct a search token container.
27
28=cut
29
30sub new {
31 my ( $class, $search, $tokens, $options ) = @_;
32 my $this = bless(
33 {
34 tokens => $tokens,
35 search => $search,
36 options => $options,
37 },
38 $class
39 );
40 return $this;
41}
42
43=begin TML
44
45---++ ObjectMethod tokens() -> \@tokenList
46
47Return a ref to a list of tokens that are ANDed to perform the search.
48
49=cut
50
51sub tokens {
52 my $this = shift;
53 return [] unless $this->{tokens};
54 return $this->{tokens};
55}
56
57=begin TML
58
59---++ ObjectMethod isEmpty() -> boolean
60
61Return true if this search is empty (has no tokens)
62
63=cut
64
65sub isEmpty {
66 my $this = shift;
67 return !( $this->{tokens} && scalar( @{ $this->{tokens} } ) > 0 );
68}
69
70sub stringify {
71 my $this = shift;
72 return
73 join( ' ', @{ $this->{tokens} } ) . ' {'
74 . join( ',',
75 map { "$_=>$this->{options}->{$_}" }
76 grep { !/^_/ } keys %{ $this->{options} } )
77 . '}';
78}
79
80=begin TML
81
82---++ ObjectMethod simplify(%opts)
83
84does nothing yet
85
86=cut
87
88sub simplify {
89}
90
9114µs1;
92__END__