← 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/Macros/IF.pm
StatementsExecuted 697 statements in 1.97ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
43111.64ms39.8msFoswiki::::IFFoswiki::IF
4311408µs16.6msFoswiki::::__ANON__[:50]Foswiki::__ANON__[:50]
431192µs92µsFoswiki::::__ANON__[:59]Foswiki::__ANON__[:59]
11114µs27µsFoswiki::::BEGIN@4.65Foswiki::BEGIN@4.65
11111µs15µsFoswiki::::BEGIN@5.66Foswiki::BEGIN@5.66
1114µs4µsFoswiki::::BEGIN@7.67Foswiki::BEGIN@7.67
0000s0sFoswiki::::__ANON__[:56]Foswiki::__ANON__[:56]
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
4227µs240µs
# spent 27µs (14+13) within Foswiki::BEGIN@4.65 which was called: # once (14µs+13µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 27µs making 1 call to Foswiki::BEGIN@4.65 # spent 13µs making 1 call to strict::import
5244µs219µs
# spent 15µs (11+4) within Foswiki::BEGIN@5.66 which was called: # once (11µs+4µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 15µs making 1 call to Foswiki::BEGIN@5.66 # spent 4µs making 1 call to warnings::import
6
7
# spent 4µs within Foswiki::BEGIN@7.67 which was called: # once (4µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 12
BEGIN {
814µs if ( $Foswiki::cfg{UseLocale} ) {
9 require locale;
10 import locale();
11 }
121290µs14µs}
# spent 4µs making 1 call to Foswiki::BEGIN@7.67
13
141200nsour $ifParser;
15
16
# spent 39.8ms (1.64+38.1) within Foswiki::IF which was called 43 times, avg 925µs/call: # 43 times (1.64ms+38.1ms) by Foswiki::_expandMacroOnTopicRendering at line 3435 of /var/www/foswikidev/core/lib/Foswiki.pm, avg 925µs/call
sub IF {
174323µs my ( $this, $params, $topicObject ) = @_;
18
194310µs unless ($ifParser) {
20169µs require Foswiki::If::Parser;
2113µs11.48ms $ifParser = new Foswiki::If::Parser();
# spent 1.48ms making 1 call to Foswiki::If::Parser::new
22 }
23
244317µs my $texpr = $params->{_DEFAULT};
25435µs $texpr = '' unless defined $texpr;
26434µs my $expr;
27433µs my $result;
28
29 # Recursion block.
304314µs $this->{evaluating_if} ||= {};
31
32 # Block after 5 levels.
334329µs if ( $this->{evaluating_if}->{$texpr}
34 && $this->{evaluating_if}->{$texpr} > 5 )
35 {
36 delete $this->{evaluating_if}->{$texpr};
37 return '';
38 }
394350µs $this->{evaluating_if}->{$texpr}++;
40
# spent 16.6ms (408µs+16.2) within Foswiki::__ANON__[/var/www/foswikidev/core/lib/Foswiki/Macros/IF.pm:50] which was called 43 times, avg 385µs/call: # 43 times (408µs+16.2ms) by Error::subs::try at line 419 of Error.pm, avg 385µs/call
try {
414368µs438.58ms $expr = $ifParser->parse($texpr);
# spent 8.58ms making 43 calls to Foswiki::Infix::Parser::parse, avg 200µs/call
4243158µs437.32ms if ( $expr->evaluate( tom => $topicObject, data => $topicObject ) ) {
# spent 7.32ms making 43 calls to Foswiki::Query::Node::evaluate, avg 170µs/call
43209µs $params->{then} = '' unless defined $params->{then};
442034µs20164µs $result = expandStandardEscapes( $params->{then} );
# spent 164µs making 20 calls to Foswiki::expandStandardEscapes, avg 8µs/call
45 }
46 else {
472319µs $params->{else} = '' unless defined $params->{else};
482337µs2392µs $result = expandStandardEscapes( $params->{else} );
# spent 92µs making 23 calls to Foswiki::expandStandardEscapes, avg 4µs/call
49 }
50 }
51 catch Foswiki::Infix::Error with {
52 my $e = shift;
53 $result =
54 $this->inlineAlert( 'alerts', 'generic', 'IF{', $params->stringify(),
55 '}:', $e->{-text} );
56 }
57
# spent 92µs within Foswiki::__ANON__[/var/www/foswikidev/core/lib/Foswiki/Macros/IF.pm:59] which was called 43 times, avg 2µs/call: # 43 times (92µs+0s) by Error::subs::try at line 433 of Error.pm, avg 2µs/call
finally {
5843126µs delete $this->{evaluating_if}->{$texpr};
5943749µs172298µs };
# spent 140µs making 43 calls to Error::catch, avg 3µs/call # spent 109µs making 43 calls to Error::subs::finally, avg 3µs/call # spent 48µs making 43 calls to Error::subs::with, avg 1µs/call # spent 17.1ms making 43 calls to Error::subs::try, avg 399µs/call, recursion: max depth 3, sum of overlapping time 17.1ms
6043179µs return $result;
61}
62
6312µs1;
64__END__