← 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_or.pm
StatementsExecuted 21 statements in 284µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
31134µs48µsFoswiki::Query::OP_or::::newFoswiki::Query::OP_or::new
11116µs29µsFoswiki::Query::OP_or::::BEGIN@13Foswiki::Query::OP_or::BEGIN@13
11112µs515µsFoswiki::Query::OP_or::::evaluateFoswiki::Query::OP_or::evaluate
11110µs14µsFoswiki::Query::OP_or::::BEGIN@14Foswiki::Query::OP_or::BEGIN@14
1114µs4µsFoswiki::Query::OP_or::::BEGIN@16Foswiki::Query::OP_or::BEGIN@16
0000s0sFoswiki::Query::OP_or::::evaluatesToConstantFoswiki::Query::OP_or::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_or
6N-ary OR function. Given an expression like a OR b OR c, this operator
7will build a single node that has 3 parameters, a, b, and c.
8
9=cut
10
11package Foswiki::Query::OP_or;
12
13229µs243µs
# spent 29µs (16+14) within Foswiki::Query::OP_or::BEGIN@13 which was called: # once (16µs+14µs) by Foswiki::Query::Parser::BEGIN@34 at line 13
use strict;
# spent 29µs making 1 call to Foswiki::Query::OP_or::BEGIN@13 # spent 14µs making 1 call to strict::import
14224µs218µs
# spent 14µs (10+4) within Foswiki::Query::OP_or::BEGIN@14 which was called: # once (10µs+4µs) by Foswiki::Query::Parser::BEGIN@34 at line 14
use warnings;
# spent 14µs making 1 call to Foswiki::Query::OP_or::BEGIN@14 # spent 4µs making 1 call to warnings::import
15
162179µs14µs
# spent 4µs within Foswiki::Query::OP_or::BEGIN@16 which was called: # once (4µs+0s) by Foswiki::Query::Parser::BEGIN@34 at line 16
use Foswiki::Query::OP ();
# spent 4µs making 1 call to Foswiki::Query::OP_or::BEGIN@16
1716µsour @ISA = ('Foswiki::Query::OP');
18
19
# spent 48µs (34+14) within Foswiki::Query::OP_or::new which was called 3 times, avg 16µs/call: # 3 times (34µs+14µs) by Foswiki::Query::Parser::new at line 112 of /var/www/foswikidev/core/lib/Foswiki/Query/Parser.pm, avg 16µs/call
sub new {
2032µs my $class = shift;
21
22 # Treated as arity 2 for parsing, but folds to n-ary
23329µs314µs return $class->SUPER::new(
# spent 14µs making 3 calls to Foswiki::Query::OP::new, avg 5µs/call
24 arity => 2,
25 canfold => 1,
26 name => 'or',
27 prec => 100
28 );
29}
30
31
# spent 515µs (12+503) within Foswiki::Query::OP_or::evaluate which was called: # once (12µs+503µs) by Foswiki::Query::Node::evaluate at line 223 of /var/www/foswikidev/core/lib/Foswiki/Query/Node.pm
sub evaluate {
321200ns my $this = shift;
331100ns my $node = shift;
341900ns foreach my $i ( @{ $node->{params} } ) {
3538µs30s return 1 if $i->evaluate(@_);
# spent 503µs making 3 calls to Foswiki::Query::Node::evaluate, avg 168µs/call, recursion: max depth 1, sum of overlapping time 503µs
36 }
3714µs return 0;
38}
39
40sub evaluatesToConstant {
41 my $this = shift;
42 my $node = shift;
43 my $all_const = 1;
44 foreach my $i ( @{ $node->{params} } ) {
45 my $ac = $i->evaluatesToConstant(@_);
46 return 1 if $ac && $i->evaluate(@_);
47 $all_const = 0 unless $ac;
48 }
49 return $all_const;
50}
51
5213µs1;
53__END__