← 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/META.pm
StatementsExecuted 20 statements in 294µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
31156µs20.3msFoswiki::::METAFoswiki::META
11116µs33µsFoswiki::::BEGIN@4.47Foswiki::BEGIN@4.47
11111µs17µsFoswiki::::BEGIN@5.48Foswiki::BEGIN@5.48
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
4235µs250µs
# spent 33µs (16+17) within Foswiki::BEGIN@4.47 which was called: # once (16µs+17µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 33µs making 1 call to Foswiki::BEGIN@4.47 # spent 17µs making 1 call to strict::import
52210µs224µs
# spent 17µs (11+7) within Foswiki::BEGIN@5.48 which was called: # once (11µs+7µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 17µs making 1 call to Foswiki::BEGIN@5.48 # spent 7µ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 20.3ms (56µs+20.2) within Foswiki::META which was called 3 times, avg 6.76ms/call: # 3 times (56µs+20.2ms) by Foswiki::_expandMacroOnTopicRendering at line 3160 of /var/www/foswiki11/lib/Foswiki.pm, avg 6.76ms/call
sub META {
1132µs my ( $this, $params, $topicObject ) = @_;
12
1334µs my $option = $params->{_DEFAULT} || '';
14
15 # make sure the topicObject is loaded
1639µs323µs my $loadedRev = $topicObject->getLoadedRev();
# spent 23µs making 3 calls to Foswiki::Meta::getLoadedRev, avg 8µs/call
173800ns $topicObject->load() unless defined $loadedRev;
18
19330µs620.2ms if ( $option eq 'form' ) {
# spent 12.9ms making 1 call to Foswiki::renderer # spent 4.91ms making 1 call to Foswiki::Meta::renderFormForDisplay # spent 2.36ms making 1 call to Foswiki::attach # spent 44µs making 1 call to Foswiki::Render::renderParent # spent 23µs making 1 call to Foswiki::Attach::renderMetaData # spent 5µs making 1 call to Foswiki::expandStandardEscapes
20
21 # META:FORM and META:FIELD
22 return $topicObject->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
33 return $this->attach->renderMetaData( $topicObject, $params );
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
41 return expandStandardEscapes(
42 $this->renderer->renderParent( $topicObject, $params ) );
43 }
44
45 # return nothing if invalid parameter
46 return '';
47}
48
4913µs1;
50__END__