← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 19:05:14 2015
Reported on Fri Jul 31 19:08:10 2015

Filename/var/www/foswiki11/lib/Foswiki/Query/Parser.pm
StatementsExecuted 204 statements in 2.73ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
33321.9ms28.2msFoswiki::Query::Parser::::newFoswiki::Query::Parser::new
1112.57ms4.41msFoswiki::Query::Parser::::BEGIN@17Foswiki::Query::Parser::BEGIN@17
1112.12ms2.78msFoswiki::Query::Parser::::BEGIN@20Foswiki::Query::Parser::BEGIN@20
11125µs48µsFoswiki::Query::Parser::::BEGIN@13Foswiki::Query::Parser::BEGIN@13
11121µs46µsFoswiki::Query::Parser::::BEGIN@15Foswiki::Query::Parser::BEGIN@15
11117µs26µsFoswiki::Query::Parser::::BEGIN@14Foswiki::Query::Parser::BEGIN@14
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
2
3=begin TML
4
5---+ package Foswiki::Query::Parser
6
7Parser for queries
8
9=cut
10
11package Foswiki::Query::Parser;
12
13247µs270µs
# spent 48µs (25+22) within Foswiki::Query::Parser::BEGIN@13 which was called: # once (25µs+22µs) by Foswiki::If::Parser::BEGIN@16 at line 13
use strict;
# spent 48µs making 1 call to Foswiki::Query::Parser::BEGIN@13 # spent 22µs making 1 call to strict::import
14247µs235µs
# spent 26µs (17+9) within Foswiki::Query::Parser::BEGIN@14 which was called: # once (17µs+9µs) by Foswiki::If::Parser::BEGIN@16 at line 14
use warnings;
# spent 26µs making 1 call to Foswiki::Query::Parser::BEGIN@14 # spent 9µs making 1 call to warnings::import
15246µs270µs
# spent 46µs (21+24) within Foswiki::Query::Parser::BEGIN@15 which was called: # once (21µs+24µs) by Foswiki::If::Parser::BEGIN@16 at line 15
use Assert;
# spent 46µs making 1 call to Foswiki::Query::Parser::BEGIN@15 # spent 24µs making 1 call to Assert::import
16
172213µs14.41ms
# spent 4.41ms (2.57+1.84) within Foswiki::Query::Parser::BEGIN@17 which was called: # once (2.57ms+1.84ms) by Foswiki::If::Parser::BEGIN@16 at line 17
use Foswiki::Infix::Parser ();
# spent 4.41ms making 1 call to Foswiki::Query::Parser::BEGIN@17
18126µsour @ISA = ('Foswiki::Infix::Parser');
19
202398µs12.78ms
# spent 2.78ms (2.12+657µs) within Foswiki::Query::Parser::BEGIN@20 which was called: # once (2.12ms+657µs) by Foswiki::If::Parser::BEGIN@16 at line 20
use Foswiki::Query::Node ();
# spent 2.78ms making 1 call to Foswiki::Query::Parser::BEGIN@20
21
22# Operators
23#
24# In the following, the standard InfixParser node structure is extended by
25# one field, 'exec'.
26#
27# exec is the name of a member function of the 'Query' class that evaluates
28# the node. It is called on the node and is passed a $domain. The $domain
29# is a reference to a hash that contains the data being operated on, and a
30# reference to the meta-data of the topic being worked on (this is
31# effectively the "topic object"). The data being operated on can be a
32# Meta object, a reference to an array (such as attachments), a reference
33# to a hash (such as TOPICINFO) or a scalar. Arrays can contain other arrays
34# and hashes.
35
36
# spent 28.2ms (21.9+6.31) within Foswiki::Query::Parser::new which was called 3 times, avg 9.41ms/call: # once (20.7ms+5.18ms) by Foswiki::If::Parser::new at line 25 of /var/www/foswiki11/lib/Foswiki/If/Parser.pm # once (723µs+655µs) by Foswiki::QUERY at line 47 of /var/www/foswiki11/lib/Foswiki/Macros/QUERY.pm # once (532µs+474µs) by Foswiki::Search::parseSearch at line 119 of /var/www/foswiki11/lib/Foswiki/Search.pm
sub new {
3737µs my ( $class, $options ) = @_;
38
39316µs $options->{words} ||= qr/([A-Z][A-Z0-9_:]*|({[A-Z][A-Z0-9_]*})+)/i;
4035µs $options->{nodeClass} ||= 'Foswiki::Query::Node';
41344µs361µs my $this = $class->SUPER::new($options);
# spent 61µs making 3 calls to Foswiki::Infix::Parser::new, avg 20µs/call
4235µs die "{Operators}{Query} is undefined; re-run configure"
43 unless defined( $Foswiki::cfg{Operators}{Query} );
4439µs foreach my $op ( @{ $Foswiki::cfg{Operators}{Query} } ) {
45571.30ms eval "require $op";
# spent 135µs executing statements in 3 string evals (merged) # spent 130µs executing statements in 3 string evals (merged) # spent 116µs executing statements in 3 string evals (merged) # spent 114µs executing statements in 3 string evals (merged) # spent 110µs executing statements in 3 string evals (merged) # spent 110µs executing statements in 3 string evals (merged) # spent 109µs executing statements in 3 string evals (merged) # spent 108µs executing statements in 3 string evals (merged) # spent 106µs executing statements in 3 string evals (merged) # spent 106µs executing statements in 3 string evals (merged) # spent 105µs executing statements in 3 string evals (merged) # spent 105µs executing statements in 3 string evals (merged) # spent 104µs executing statements in 3 string evals (merged) # spent 104µs executing statements in 3 string evals (merged) # spent 103µs executing statements in 3 string evals (merged) # spent 103µs executing statements in 3 string evals (merged) # spent 103µs executing statements in 3 string evals (merged) # spent 102µs executing statements in 3 string evals (merged) # spent 96µs executing statements in 3 string evals (merged)
4657112µs57100µs ASSERT( !$@, $@ ) if DEBUG;
# spent 100µs making 57 calls to Assert::ASSERTS_OFF, avg 2µs/call
4757434µs1142.15ms $this->addOperator( $op->new() );
# spent 175µs making 57 calls to Foswiki::Infix::Parser::addOperator, avg 3µs/call # spent 150µs making 3 calls to Foswiki::Query::OP_match::new, avg 50µs/call # spent 125µs making 3 calls to Foswiki::Query::OP_lc::new, avg 42µs/call # spent 106µs making 3 calls to Foswiki::Query::OP_ref::new, avg 35µs/call # spent 106µs making 3 calls to Foswiki::Query::OP_and::new, avg 35µs/call # spent 104µs making 3 calls to Foswiki::Query::OP_not::new, avg 35µs/call # spent 103µs making 3 calls to Foswiki::Query::OP_ob::new, avg 34µs/call # spent 102µs making 3 calls to Foswiki::Query::OP_dot::new, avg 34µs/call # spent 102µs making 3 calls to Foswiki::Query::OP_eq::new, avg 34µs/call # spent 100µs making 3 calls to Foswiki::Query::OP_d2n::new, avg 33µs/call # spent 100µs making 3 calls to Foswiki::Query::OP_lte::new, avg 33µs/call # spent 100µs making 3 calls to Foswiki::Query::OP_length::new, avg 33µs/call # spent 100µs making 3 calls to Foswiki::Query::OP_lt::new, avg 33µs/call # spent 98µs making 3 calls to Foswiki::Query::OP_ne::new, avg 33µs/call # spent 98µs making 3 calls to Foswiki::Query::OP_gt::new, avg 33µs/call # spent 98µs making 3 calls to Foswiki::Query::OP_like::new, avg 33µs/call # spent 98µs making 3 calls to Foswiki::Query::OP_gte::new, avg 32µs/call # spent 97µs making 3 calls to Foswiki::Query::OP_where::new, avg 32µs/call # spent 96µs making 3 calls to Foswiki::Query::OP_or::new, avg 32µs/call # spent 95µs making 3 calls to Foswiki::Query::OP_uc::new, avg 32µs/call
48 }
49319µs return $this;
50}
51
5215µs1;
53__END__