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

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/META.pm
StatementsExecuted 23 statements in 532µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
311136µs1.37sFoswiki::::METAFoswiki::META
11140µs54µsFoswiki::::BEGIN@4.42Foswiki::BEGIN@4.42
11130µs64µsFoswiki::::BEGIN@5.43Foswiki::BEGIN@5.43
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
4265µs268µs
# spent 54µs (40+14) within Foswiki::BEGIN@4.42 which was called: # once (40µs+14µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 54µs making 1 call to Foswiki::BEGIN@4.42 # spent 14µs making 1 call to strict::import
52328µs297µs
# spent 64µs (30+34) within Foswiki::BEGIN@5.43 which was called: # once (30µs+34µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 64µs making 1 call to Foswiki::BEGIN@5.43 # spent 34µs making 1 call to warnings::import
6
7# See System.VarMETA
8# Before calling, ensure the topicObject is loaded with the version of the
9# topic you intend to display!
10
# spent 1.37s (136µs+1.37) within Foswiki::META which was called 3 times, avg 456ms/call: # 3 times (136µs+1.37s) by Foswiki::_expandMacroOnTopicRendering at line 3066 of /usr/local/src/github.com/foswiki/core/lib/Foswiki.pm, avg 456ms/call
sub META {
1118135µs my ( $this, $params, $topicObject ) = @_;
12
13 my $option = $params->{_DEFAULT} || '';
14
15 # make sure the topicObject is loaded
16379µs my $loadedRev = $topicObject->getLoadedRev();
# spent 79µs making 3 calls to Foswiki::Meta::getLoadedRev, avg 26µs/call
17 $topicObject = $topicObject->load() unless defined $loadedRev;
18
19 if ( $option eq 'form' ) {
20
21 # META:FORM and META:FIELD
2211.36s return $topicObject->renderFormForDisplay();
# spent 1.36s making 1 call to Foswiki::Meta::renderFormForDisplay
23 }
24 elsif ( $option eq 'formfield' ) {
25
26 # a formfield from within topic text
27 return $topicObject->renderFormFieldForDisplay( $params->get('name'),
28 '$value', $params );
29 }
30 elsif ( $option eq 'attachments' ) {
31
32 # renders attachment tables
3324.68ms return $this->attach->renderMetaData( $topicObject, $params );
# spent 4.63ms making 1 call to Foswiki::attach # spent 54µs making 1 call to Foswiki::Attach::renderMetaData
34 }
35 elsif ( $option eq 'moved' ) {
36 return $this->renderer->renderMoved( $topicObject, $params );
37 }
38 elsif ( $option eq 'parent' ) {
39
40 # Only parent parameter has the format option and should do std escapes
413194µs return expandStandardEscapes(
# spent 121µs making 1 call to Foswiki::Render::renderParent # spent 64µs making 1 call to Foswiki::expandStandardEscapes # spent 8µs making 1 call to Foswiki::renderer
42 $this->renderer->renderParent( $topicObject, $params ) );
43 }
44
45 # return nothing if invalid parameter
46 return '';
47}
48
4914µs1;
50__END__