← 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:18 2011

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/OP_and.pm
StatementsExecuted 92 statements in 822µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1311440µs6.47msFoswiki::Query::OP_and::::evaluateFoswiki::Query::OP_and::evaluate
31183µs128µsFoswiki::Query::OP_and::::newFoswiki::Query::OP_and::new
11124µs32µsFoswiki::Query::OP_and::::BEGIN@13Foswiki::Query::OP_and::BEGIN@13
11116µs34µsFoswiki::Query::OP_and::::BEGIN@14Foswiki::Query::OP_and::BEGIN@14
1119µs9µ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
13246µs239µs
# spent 32µs (24+7) within Foswiki::Query::OP_and::BEGIN@13 which was called: # once (24µs+7µs) by Foswiki::Query::Parser::BEGIN@29 at line 13
use strict;
# spent 32µs making 1 call to Foswiki::Query::OP_and::BEGIN@13 # spent 7µs making 1 call to strict::import
14243µs252µs
# spent 34µs (16+18) within Foswiki::Query::OP_and::BEGIN@14 which was called: # once (16µs+18µs) by Foswiki::Query::Parser::BEGIN@29 at line 14
use warnings;
# spent 34µs making 1 call to Foswiki::Query::OP_and::BEGIN@14 # spent 18µs making 1 call to warnings::import
15
162280µs19µs
# spent 9µs within Foswiki::Query::OP_and::BEGIN@16 which was called: # once (9µs+0s) by Foswiki::Query::Parser::BEGIN@29 at line 16
use Foswiki::Query::OP ();
# spent 9µs making 1 call to Foswiki::Query::OP_and::BEGIN@16
1719µsour @ISA = ('Foswiki::Query::OP');
18
19
# spent 128µs (83+45) within Foswiki::Query::OP_and::new which was called 3 times, avg 43µs/call: # 3 times (83µs+45µs) by Foswiki::Query::Parser::new at line 105 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/Parser.pm, avg 43µs/call
sub new {
2036µs my $class = shift;
21
22 # Treated as arity 2 for parsing, but folds to n-ary
23364µs345µs return $class->SUPER::new(
# spent 45µs making 3 calls to Foswiki::Query::OP::new, avg 15µs/call
24 arity => 2,
25 canfold => 1,
26 name => 'and',
27 prec => 200
28 );
29}
30
31
# spent 6.47ms (440µs+6.04) within Foswiki::Query::OP_and::evaluate which was called 13 times, avg 498µs/call: # 13 times (440µs+6.04ms) by Foswiki::Query::Node::evaluate at line 223 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/Node.pm, avg 498µs/call
sub evaluate {
321324µs my $this = shift;
331317µs my $node = shift;
342687µs foreach my $i ( @{ $node->{params} } ) {
3524231µs240s return 0 unless $i->evaluate(@_);
# spent 6.04ms making 24 calls to Foswiki::Query::Node::evaluate, avg 251µs/call, recursion: max depth 1, sum of overlapping time 6.04ms
36 }
37210µ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
5016µs1;
51__END__