← 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:26:56 2011

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/If/OP_defined.pm
StatementsExecuted 136 statements in 971µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1011590µs2.29msFoswiki::If::OP_defined::::evaluateFoswiki::If::OP_defined::evaluate
11133µs62µsFoswiki::If::OP_defined::::newFoswiki::If::OP_defined::new
11124µs32µsFoswiki::If::OP_defined::::BEGIN@11Foswiki::If::OP_defined::BEGIN@11
11117µs35µsFoswiki::If::OP_defined::::BEGIN@12Foswiki::If::OP_defined::BEGIN@12
1119µs9µsFoswiki::If::OP_defined::::BEGIN@14Foswiki::If::OP_defined::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::If::OP_defined
6
7=cut
8
9package Foswiki::If::OP_defined;
10
11251µs239µs
# spent 32µs (24+7) within Foswiki::If::OP_defined::BEGIN@11 which was called: # once (24µs+7µs) by Foswiki::If::Parser::BEGIN@24 at line 11
use strict;
# spent 32µs making 1 call to Foswiki::If::OP_defined::BEGIN@11 # spent 7µs making 1 call to strict::import
12244µs252µs
# spent 35µs (17+18) within Foswiki::If::OP_defined::BEGIN@12 which was called: # once (17µs+18µs) by Foswiki::If::Parser::BEGIN@24 at line 12
use warnings;
# spent 35µs making 1 call to Foswiki::If::OP_defined::BEGIN@12 # spent 18µs making 1 call to warnings::import
13
142295µs19µs
# spent 9µs within Foswiki::If::OP_defined::BEGIN@14 which was called: # once (9µs+0s) by Foswiki::If::Parser::BEGIN@24 at line 14
use Foswiki::Query::UnaryOP ();
# spent 9µs making 1 call to Foswiki::If::OP_defined::BEGIN@14
1519µsour @ISA = ('Foswiki::Query::UnaryOP');
16
17
# spent 62µs (33+29) within Foswiki::If::OP_defined::new which was called: # once (33µs+29µs) by Foswiki::If::Parser::new at line 42 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/If/Parser.pm
sub new {
18228µs my $class = shift;
19129µs return $class->SUPER::new( name => 'defined', prec => 600 );
# spent 29µs making 1 call to Foswiki::Query::UnaryOP::new
20}
21
22
# spent 2.29ms (590µs+1.70) within Foswiki::If::OP_defined::evaluate which was called 10 times, avg 229µs/call: # 10 times (590µs+1.70ms) by Foswiki::Query::Node::evaluate at line 223 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/Node.pm, avg 229µs/call
sub evaluate {
23126539µs my $this = shift;
24 my $node = shift;
25 my $a = $node->{params}[0];
26 my %domain = @_;
271051µs my $session = $domain{tom}->session;
# spent 51µs making 10 calls to Foswiki::Meta::session, avg 5µs/call
28 throw Error::Simple(
29 'No context in which to evaluate "' . $a->stringify() . '"' )
30 unless $session;
31
32 # NOTE: If::Node::_evaluate(), not Query::Node::evaluate
331093µs my $eval = $a->_evaluate(@_);
# spent 93µs making 10 calls to Foswiki::If::Node::_evaluate, avg 9µs/call
34
35#print STDERR "Evaluate ".$node->stringify()." -> ".(defined $eval ? $eval : 'undef')."\n";
36 return 0 unless $eval;
3710594µs return 1 if ( defined( $session->{request}->param($eval) ) );
# spent 594µs making 10 calls to Foswiki::Request::param, avg 59µs/call
3810243µs return 1 if ( defined( $domain{tom}->getPreference($eval) ) );
# spent 243µs making 10 calls to Foswiki::Meta::getPreference, avg 24µs/call
3910718µs return 1 if ( defined( $session->{prefs}->getPreference($eval) ) );
# spent 718µs making 10 calls to Foswiki::Prefs::getPreference, avg 72µs/call
40 return 1 if ( exists( $Foswiki::macros{$eval} ) );
41 return 0;
42}
43
4416µs1;
45__END__