← 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:52 2011

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/IF.pm
StatementsExecuted 1208 statements in 8.34ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
75116.02ms134msFoswiki::::IFFoswiki::IF
75112.18ms79.9msFoswiki::::__ANON__[:43]Foswiki::__ANON__[:43]
7511412µs412µsFoswiki::::__ANON__[:52]Foswiki::__ANON__[:52]
11125µs33µsFoswiki::::BEGIN@4.27Foswiki::BEGIN@4.27
11117µs36µsFoswiki::::BEGIN@5.28Foswiki::BEGIN@5.28
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
4253µs240µs
# spent 33µs (25+7) within Foswiki::BEGIN@4.27 which was called: # once (25µs+7µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 33µs making 1 call to Foswiki::BEGIN@4.27 # spent 7µs making 1 call to strict::import
52524µs255µs
# spent 36µs (17+19) within Foswiki::BEGIN@5.28 which was called: # once (17µs+19µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 36µs making 1 call to Foswiki::BEGIN@5.28 # spent 19µs making 1 call to warnings::import
6
711µsour $ifParser;
8
9
# spent 134ms (6.02+128) within Foswiki::IF which was called 75 times, avg 1.78ms/call: # 75 times (6.02ms+128ms) by Foswiki::_expandMacroOnTopicRendering at line 3066 of /usr/local/src/github.com/foswiki/core/lib/Foswiki.pm, avg 1.78ms/call
sub IF {
108255.05ms my ( $this, $params, $topicObject ) = @_;
11
122110µs unless ($ifParser) {
13 require Foswiki::If::Parser;
1413.54ms $ifParser = new Foswiki::If::Parser();
# spent 3.54ms making 1 call to Foswiki::If::Parser::new
15 }
16
17 my $texpr = $params->{_DEFAULT};
18 $texpr = '' unless defined $texpr;
19 my $expr;
20 my $result;
21
22 # Recursion block.
23 $this->{evaluating_if} ||= {};
24
25 # Block after 5 levels.
26 if ( $this->{evaluating_if}->{$texpr}
27 && $this->{evaluating_if}->{$texpr} > 5 )
28 {
29 delete $this->{evaluating_if}->{$texpr};
30 return '';
31 }
32 $this->{evaluating_if}->{$texpr}++;
33
# spent 79.9ms (2.18+77.7) within Foswiki::__ANON__[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/IF.pm:43] which was called 75 times, avg 1.07ms/call: # 75 times (2.18ms+77.7ms) by Error::subs::try at line 416 of Error.pm, avg 1.07ms/call
try {
341501.38ms7544.2ms $expr = $ifParser->parse($texpr);
# spent 44.2ms making 75 calls to Foswiki::Infix::Parser::parse, avg 589µs/call
35150727µs7528.3ms if ( $expr->evaluate( tom => $topicObject, data => $topicObject ) ) {
# spent 28.3ms making 75 calls to Foswiki::Query::Node::evaluate, avg 378µs/call
36 $params->{then} = '' unless defined $params->{then};
3714999µs $result = expandStandardEscapes( $params->{then} );
# spent 999µs making 14 calls to Foswiki::expandStandardEscapes, avg 71µs/call
38 }
39 else {
40 $params->{else} = '' unless defined $params->{else};
41614.21ms $result = expandStandardEscapes( $params->{else} );
# spent 4.21ms making 61 calls to Foswiki::expandStandardEscapes, avg 69µ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 412µs within Foswiki::__ANON__[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/IF.pm:52] which was called 75 times, avg 5µs/call: # 75 times (412µs+0s) by Error::subs::try at line 430 of Error.pm, avg 5µs/call
finally {
5175492µs delete $this->{evaluating_if}->{$texpr};
523002.13ms };
# spent 1.14ms making 75 calls to Error::catch, avg 15µs/call # spent 665µs making 75 calls to Error::subs::finally, avg 9µs/call # spent 331µs making 75 calls to Error::subs::with, avg 4µs/call # spent 83.9ms making 75 calls to Error::subs::try, avg 1.12ms/call, recursion: max depth 3, sum of overlapping time 83.9ms
53 return $result;
54}
55
5615µs1;
57__END__