← 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/If/OP_defined.pm
StatementsExecuted 175 statements in 462µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1311233µs1.18msFoswiki::If::OP_defined::::evaluateFoswiki::If::OP_defined::evaluate
11117µs30µsFoswiki::If::OP_defined::::BEGIN@11Foswiki::If::OP_defined::BEGIN@11
11116µs29µsFoswiki::If::OP_defined::::newFoswiki::If::OP_defined::new
11112µs15µsFoswiki::If::OP_defined::::BEGIN@12Foswiki::If::OP_defined::BEGIN@12
1116µs6µsFoswiki::If::OP_defined::::BEGIN@17Foswiki::If::OP_defined::BEGIN@17
1114µs4µ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
11226µs242µs
# spent 30µs (17+12) within Foswiki::If::OP_defined::BEGIN@11 which was called: # once (17µs+12µs) by Foswiki::If::Parser::BEGIN@24 at line 11
use strict;
# spent 30µs making 1 call to Foswiki::If::OP_defined::BEGIN@11 # spent 12µs making 1 call to strict::import
12223µs219µs
# spent 15µs (12+4) within Foswiki::If::OP_defined::BEGIN@12 which was called: # once (12µs+4µs) by Foswiki::If::Parser::BEGIN@24 at line 12
use warnings;
# spent 15µs making 1 call to Foswiki::If::OP_defined::BEGIN@12 # spent 4µs making 1 call to warnings::import
13
14253µs14µs
# spent 4µs within Foswiki::If::OP_defined::BEGIN@14 which was called: # once (4µs+0s) by Foswiki::If::Parser::BEGIN@24 at line 14
use Foswiki::Query::UnaryOP ();
# spent 4µs making 1 call to Foswiki::If::OP_defined::BEGIN@14
1516µsour @ISA = ('Foswiki::Query::UnaryOP');
16
17
# spent 6µs within Foswiki::If::OP_defined::BEGIN@17 which was called: # once (6µs+0s) by Foswiki::If::Parser::BEGIN@24 at line 22
BEGIN {
1814µs if ( $Foswiki::cfg{UseLocale} ) {
19 require locale;
20 import locale();
21 }
221150µs16µs}
# spent 6µs making 1 call to Foswiki::If::OP_defined::BEGIN@17
23
24
# spent 29µs (16+14) within Foswiki::If::OP_defined::new which was called: # once (16µs+14µs) by Foswiki::If::Parser::new at line 49 of /var/www/foswikidev/core/lib/Foswiki/If/Parser.pm
sub new {
251400ns my $class = shift;
26115µs114µs return $class->SUPER::new( name => 'defined', prec => 600 );
# spent 14µs making 1 call to Foswiki::Query::UnaryOP::new
27}
28
29
# spent 1.18ms (233µs+944µs) within Foswiki::If::OP_defined::evaluate which was called 13 times, avg 91µs/call: # 13 times (233µs+944µs) by Foswiki::Query::Node::evaluate at line 223 of /var/www/foswikidev/core/lib/Foswiki/Query/Node.pm, avg 91µs/call
sub evaluate {
30133µs my $this = shift;
31132µs my $node = shift;
32136µs my $a = $node->{params}[0];
331310µs my %domain = @_;
341318µs1316µs my $session = $domain{tom}->session;
# spent 16µs making 13 calls to Foswiki::Meta::session, avg 1µs/call
35133µs throw Error::Simple(
36 'No context in which to evaluate "' . $a->stringify() . '"' )
37 unless $session;
38
39 # NOTE: If::Node::_evaluate(), not Query::Node::evaluate
401321µs1325µs my $eval = $a->_evaluate(@_);
# spent 25µs making 13 calls to Foswiki::If::Node::_evaluate, avg 2µs/call
41
42#print STDERR "Evaluate ".$node->stringify()." -> ".(defined $eval ? $eval : 'undef')."\n";
43132µs return 0 unless $eval;
441324µs13223µs return 1 if ( defined( $session->{request}->param($eval) ) );
# spent 223µs making 13 calls to Foswiki::Request::param, avg 17µs/call
451324µs13400µs return 1 if ( defined( $domain{tom}->getPreference($eval) ) );
# spent 400µs making 13 calls to Foswiki::Meta::getPreference, avg 31µs/call
461331µs13280µs return 1 if ( defined( $session->{prefs}->getPreference($eval) ) );
# spent 280µs making 13 calls to Foswiki::Prefs::getPreference, avg 22µs/call
47118µs return 1 if ( exists( $Foswiki::macros{$eval} ) );
481027µs return 0;
49}
50
5113µs1;
52__END__