← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 19:05:14 2015
Reported on Fri Jul 31 19:08:10 2015

Filename/var/www/foswiki11/lib/Foswiki/Macros/IF.pm
StatementsExecuted 664 statements in 2.73ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41111.99ms77.0msFoswiki::::IFFoswiki::IF
4111528µs34.9msFoswiki::::__ANON__[:43]Foswiki::__ANON__[:43]
4111116µs116µsFoswiki::::__ANON__[:52]Foswiki::__ANON__[:52]
11124µs48µsFoswiki::::BEGIN@4.43Foswiki::BEGIN@4.43
11118µs27µsFoswiki::::BEGIN@5.44Foswiki::BEGIN@5.44
0000s0sFoswiki::::__ANON__[:49]Foswiki::__ANON__[:49]
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
2package Foswiki;
3
4250µs273µs
# spent 48µs (24+24) within Foswiki::BEGIN@4.43 which was called: # once (24µs+24µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 48µs making 1 call to Foswiki::BEGIN@4.43 # spent 24µs making 1 call to strict::import
52581µs236µs
# spent 27µs (18+9) within Foswiki::BEGIN@5.44 which was called: # once (18µs+9µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 27µs making 1 call to Foswiki::BEGIN@5.44 # spent 9µs making 1 call to warnings::import
6
71200nsour $ifParser;
8
9
# spent 77.0ms (1.99+75.0) within Foswiki::IF which was called 41 times, avg 1.88ms/call: # 41 times (1.99ms+75.0ms) by Foswiki::_expandMacroOnTopicRendering at line 3160 of /var/www/foswiki11/lib/Foswiki.pm, avg 1.88ms/call
sub IF {
104129µs my ( $this, $params, $topicObject ) = @_;
11
124113µs unless ($ifParser) {
131130µs require Foswiki::If::Parser;
1416µs130.5ms $ifParser = new Foswiki::If::Parser();
# spent 30.5ms making 1 call to Foswiki::If::Parser::new
15 }
16
174123µs my $texpr = $params->{_DEFAULT};
18417µs $texpr = '' unless defined $texpr;
19415µs my $expr;
20415µs my $result;
21
22 # Recursion block.
234120µs $this->{evaluating_if} ||= {};
24
25 # Block after 5 levels.
264125µs if ( $this->{evaluating_if}->{$texpr}
27 && $this->{evaluating_if}->{$texpr} > 5 )
28 {
29 delete $this->{evaluating_if}->{$texpr};
30 return '';
31 }
324160µs $this->{evaluating_if}->{$texpr}++;
33
# spent 34.9ms (528µs+34.4) within Foswiki::__ANON__[/var/www/foswiki11/lib/Foswiki/Macros/IF.pm:43] which was called 41 times, avg 851µs/call: # 41 times (528µs+34.4ms) by Error::subs::try at line 419 of Error.pm, avg 851µs/call
try {
344191µs4122.5ms $expr = $ifParser->parse($texpr);
# spent 22.5ms making 41 calls to Foswiki::Infix::Parser::parse, avg 549µs/call
3541191µs4111.5ms if ( $expr->evaluate( tom => $topicObject, data => $topicObject ) ) {
# spent 11.5ms making 41 calls to Foswiki::Query::Node::evaluate, avg 280µs/call
362012µs $params->{then} = '' unless defined $params->{then};
372043µs20215µs $result = expandStandardEscapes( $params->{then} );
# spent 215µs making 20 calls to Foswiki::expandStandardEscapes, avg 11µs/call
38 }
39 else {
402142µs $params->{else} = '' unless defined $params->{else};
412144µs21136µs $result = expandStandardEscapes( $params->{else} );
# spent 136µs making 21 calls to Foswiki::expandStandardEscapes, avg 6µs/call
42 }
43 }
44 catch Foswiki::Infix::Error with {
45 my $e = shift;
46 $result =
47 $this->inlineAlert( 'alerts', 'generic', 'IF{', $params->stringify(),
48 '}:', $e->{-text} );
49 }
50
# spent 116µs within Foswiki::__ANON__[/var/www/foswiki11/lib/Foswiki/Macros/IF.pm:52] which was called 41 times, avg 3µs/call: # 41 times (116µs+0s) by Error::subs::try at line 433 of Error.pm, avg 3µs/call
finally {
5141154µs delete $this->{evaluating_if}->{$texpr};
5241978µs164406µs };
# spent 199µs making 41 calls to Error::catch, avg 5µs/call # spent 144µs making 41 calls to Error::subs::finally, avg 4µs/call # spent 62µs making 41 calls to Error::subs::with, avg 2µs/call # spent 35.6ms making 41 calls to Error::subs::try, avg 869µs/call, recursion: max depth 3, sum of overlapping time 35.6ms
5341214µs return $result;
54}
55
5614µs1;
57__END__