← 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_or.pm
StatementsExecuted 22 statements in 552µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
311103µs147µsFoswiki::Query::OP_or::::newFoswiki::Query::OP_or::new
11146µs1.89msFoswiki::Query::OP_or::::evaluateFoswiki::Query::OP_or::evaluate
11125µs33µsFoswiki::Query::OP_or::::BEGIN@13Foswiki::Query::OP_or::BEGIN@13
11117µs36µsFoswiki::Query::OP_or::::BEGIN@14Foswiki::Query::OP_or::BEGIN@14
11110µs10µ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
13249µs241µs
# spent 33µs (25+8) within Foswiki::Query::OP_or::BEGIN@13 which was called: # once (25µs+8µs) by Foswiki::Query::Parser::BEGIN@27 at line 13
use strict;
# spent 33µs making 1 call to Foswiki::Query::OP_or::BEGIN@13 # spent 8µs making 1 call to strict::import
14244µs255µs
# spent 36µs (17+19) within Foswiki::Query::OP_or::BEGIN@14 which was called: # once (17µs+19µs) by Foswiki::Query::Parser::BEGIN@27 at line 14
use warnings;
# spent 36µs making 1 call to Foswiki::Query::OP_or::BEGIN@14 # spent 19µs making 1 call to warnings::import
15
162302µs110µs
# spent 10µs within Foswiki::Query::OP_or::BEGIN@16 which was called: # once (10µs+0s) by Foswiki::Query::Parser::BEGIN@27 at line 16
use Foswiki::Query::OP ();
# spent 10µs making 1 call to Foswiki::Query::OP_or::BEGIN@16
1719µsour @ISA = ('Foswiki::Query::OP');
18
19
# spent 147µs (103+44) within Foswiki::Query::OP_or::new which was called 3 times, avg 49µs/call: # 3 times (103µs+44µs) by Foswiki::Query::Parser::new at line 105 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/Parser.pm, avg 49µs/call
sub new {
2035µs my $class = shift;
21
22 # Treated as arity 2 for parsing, but folds to n-ary
23389µs344µs return $class->SUPER::new(
# spent 44µs making 3 calls to Foswiki::Query::OP::new, avg 15µs/call
24 arity => 2,
25 canfold => 1,
26 name => 'or',
27 prec => 100
28 );
29}
30
31
# spent 1.89ms (46µs+1.85) within Foswiki::Query::OP_or::evaluate which was called: # once (46µs+1.85ms) by Foswiki::Query::Node::evaluate at line 223 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/Node.pm
sub evaluate {
3212µs my $this = shift;
3311µs my $node = shift;
3426µs foreach my $i ( @{ $node->{params} } ) {
35331µs30s return 1 if $i->evaluate(@_);
# spent 1.85ms making 3 calls to Foswiki::Query::Node::evaluate, avg 616µs/call, recursion: max depth 1, sum of overlapping time 1.85ms
36 }
3718µ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
5216µs1;
53__END__