← 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:27:00 2011

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/QUERY.pm
StatementsExecuted 28 statements in 902µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111128µs11.1msFoswiki::::QUERYFoswiki::QUERY
11144µs2.84msFoswiki::::__ANON__[:56]Foswiki::__ANON__[:56]
11127µs35µsFoswiki::::BEGIN@4.65Foswiki::BEGIN@4.65
11123µs41µsFoswiki::::BEGIN@5.66Foswiki::BEGIN@5.66
11111µs11µsFoswiki::::BEGIN@6.67Foswiki::BEGIN@6.67
1116µs6µsFoswiki::::__ANON__[:65]Foswiki::__ANON__[:65]
0000s0sFoswiki::::__ANON__[:62]Foswiki::__ANON__[:62]
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
4262µs242µs
# spent 35µs (27+7) within Foswiki::BEGIN@4.65 which was called: # once (27µs+7µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 35µs making 1 call to Foswiki::BEGIN@4.65 # spent 8µs making 1 call to strict::import
5244µs259µs
# spent 41µs (23+18) within Foswiki::BEGIN@5.66 which was called: # once (23µs+18µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 41µs making 1 call to Foswiki::BEGIN@5.66 # spent 18µs making 1 call to warnings::import
62622µs111µs
# spent 11µs within Foswiki::BEGIN@6.67 which was called: # once (11µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 6
use Foswiki::Serialise ();
# spent 11µs making 1 call to Foswiki::BEGIN@6.67
7
811µsour $evalParser; # could share $ifParser from IF.pm
9
10
# spent 11.1ms (128µs+11.0) within Foswiki::QUERY which was called: # once (128µs+11.0ms) by Foswiki::_expandMacroOnTopicRendering at line 3066 of /usr/local/src/github.com/foswiki/core/lib/Foswiki.pm
sub QUERY {
111395µs my ( $this, $params, $topicObject ) = @_;
12 my $result;
13 my $expr = $params->{_DEFAULT};
14 $expr = '' unless defined $expr;
15 my $style = lc( $params->{style} || 'default' );
16 my $rev = $params->{rev};
17
18 # FORMFIELD does its own caching.
19 # Either the home-made cache there should go into Meta so that both
20 # FORMFIELD and QUERY benefit, or the store should be made a lot smarter.
21
2217µs132µs if ( defined $rev ) {
# spent 32µs making 1 call to Foswiki::Meta::latestIsLoaded
23 my $crev = $topicObject->getLoadedRev();
24 if ( defined $crev && $crev != $rev ) {
25 $topicObject =
26 Foswiki::Meta->load( $topicObject->session, $topicObject->web,
27 $topicObject->topic, $rev );
28 }
29 }
30 elsif ( !$topicObject->latestIsLoaded() ) {
31
32 # load latest rev
3316.03ms $topicObject = $topicObject->load();
# spent 6.03ms making 1 call to Foswiki::Meta::load
34 }
35
36 # Recursion block.
37 $this->{evaluatingEval} ||= {};
38
39 # Block after 5 levels.
40 if ( $this->{evaluatingEval}->{$expr}
41 && $this->{evaluatingEval}->{$expr} > 5 )
42 {
43 delete $this->{evaluatingEval}->{$expr};
44 return '';
45 }
46221µs unless ($evalParser) {
47 require Foswiki::Query::Parser;
4811.95ms $evalParser = new Foswiki::Query::Parser();
# spent 1.95ms making 1 call to Foswiki::Query::Parser::new
49 }
50
51 $this->{evaluatingEval}->{$expr}++;
52
# spent 2.84ms (44µs+2.80) within Foswiki::__ANON__[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/QUERY.pm:56] which was called: # once (44µs+2.80ms) by Error::subs::try at line 416 of Error.pm
try {
53336µs12.02ms my $node = $evalParser->parse($expr);
# spent 2.02ms making 1 call to Foswiki::Infix::Parser::parse
54148µs $result = $node->evaluate( tom => $topicObject, data => $topicObject );
# spent 48µs making 1 call to Foswiki::Query::Node::evaluate
551729µs $result = Foswiki::Serialise::serialise( $this, $result, $style );
# spent 729µs making 1 call to Foswiki::Serialise::serialise
56 }
57 catch Foswiki::Infix::Error with {
58 my $e = shift;
59 $result =
60 $this->inlineAlert( 'alerts', 'generic', 'QUERY{',
61 $params->stringify(), '}:', $e->{-text} );
62 }
63
# spent 6µs within Foswiki::__ANON__[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/QUERY.pm:65] which was called: # once (6µs+0s) by Error::subs::try at line 430 of Error.pm
finally {
6419µs delete $this->{evaluatingEval}->{$expr};
65436µs };
# spent 20µs making 1 call to Error::catch # spent 10µs making 1 call to Error::subs::finally # spent 7µs making 1 call to Error::subs::with # spent 2.91ms making 1 call to Error::subs::try, recursion: max depth 1, sum of overlapping time 2.91ms
66
67 return $result;
68}
69
7015µs1;
71__END__