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

Filename/var/www/foswikidev/core/lib/Foswiki/Query/OP_and.pm
StatementsExecuted 52 statements in 309µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
81158µs1.85msFoswiki::Query::OP_and::::evaluateFoswiki::Query::OP_and::evaluate
31135µs50µsFoswiki::Query::OP_and::::newFoswiki::Query::OP_and::new
11115µs28µsFoswiki::Query::OP_and::::BEGIN@13Foswiki::Query::OP_and::BEGIN@13
11110µs14µsFoswiki::Query::OP_and::::BEGIN@14Foswiki::Query::OP_and::BEGIN@14
1114µs4µsFoswiki::Query::OP_and::::BEGIN@16Foswiki::Query::OP_and::BEGIN@16
0000s0sFoswiki::Query::OP_and::::evaluatesToConstantFoswiki::Query::OP_and::evaluatesToConstant
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::OP_and
6N-ary AND function. Given an expression like a AND b AND c, this operator
7will build a single node that has 3 parameters, a, b, and c.
8
9=cut
10
11package Foswiki::Query::OP_and;
12
13228µs241µs
# spent 28µs (15+13) within Foswiki::Query::OP_and::BEGIN@13 which was called: # once (15µs+13µs) by Foswiki::Query::Parser::BEGIN@36 at line 13
use strict;
# spent 28µs making 1 call to Foswiki::Query::OP_and::BEGIN@13 # spent 13µs making 1 call to strict::import
14224µs218µs
# spent 14µs (10+4) within Foswiki::Query::OP_and::BEGIN@14 which was called: # once (10µs+4µs) by Foswiki::Query::Parser::BEGIN@36 at line 14
use warnings;
# spent 14µs making 1 call to Foswiki::Query::OP_and::BEGIN@14 # spent 4µs making 1 call to warnings::import
15
162164µs14µs
# spent 4µs within Foswiki::Query::OP_and::BEGIN@16 which was called: # once (4µs+0s) by Foswiki::Query::Parser::BEGIN@36 at line 16
use Foswiki::Query::OP ();
# spent 4µs making 1 call to Foswiki::Query::OP_and::BEGIN@16
1718µsour @ISA = ('Foswiki::Query::OP');
18
19
# spent 50µs (35+15) within Foswiki::Query::OP_and::new which was called 3 times, avg 17µs/call: # 3 times (35µs+15µs) by Foswiki::Query::Parser::new at line 112 of /var/www/foswikidev/core/lib/Foswiki/Query/Parser.pm, avg 17µs/call
sub new {
2032µs my $class = shift;
21
22 # Treated as arity 2 for parsing, but folds to n-ary
23331µs315µs return $class->SUPER::new(
# spent 15µs making 3 calls to Foswiki::Query::OP::new, avg 5µs/call
24 arity => 2,
25 canfold => 1,
26 name => 'and',
27 prec => 200
28 );
29}
30
31
# spent 1.85ms (58µs+1.79) within Foswiki::Query::OP_and::evaluate which was called 8 times, avg 231µs/call: # 8 times (58µs+1.79ms) by Foswiki::Query::Node::evaluate at line 223 of /var/www/foswikidev/core/lib/Foswiki/Query/Node.pm, avg 231µs/call
sub evaluate {
3282µs my $this = shift;
3381µs my $node = shift;
3488µs foreach my $i ( @{ $node->{params} } ) {
351234µs120s return 0 unless $i->evaluate(@_);
# spent 1.79ms making 12 calls to Foswiki::Query::Node::evaluate, avg 149µs/call, recursion: max depth 1, sum of overlapping time 1.79ms
36 }
3725µs return 1;
38}
39
40sub evaluatesToConstant {
41 my $this = shift;
42 my $node = shift;
43 foreach my $i ( @{ $node->{params} } ) {
44 return 0 unless $i->evaluatesToConstant(@_);
45 return 1 unless $i->evaluate(@_);
46 }
47 return 1;
48}
49
5013µs1;
51__END__