← 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/META.pm
StatementsExecuted 30 statements in 468µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
311515µs9.33msFoswiki::::METAFoswiki::META
11115µs27µsFoswiki::::BEGIN@4.77Foswiki::BEGIN@4.77
11110µs14µsFoswiki::::BEGIN@5.78Foswiki::BEGIN@5.78
1114µs4µsFoswiki::::BEGIN@7.79Foswiki::BEGIN@7.79
1113µs3µsFoswiki::::BEGIN@10Foswiki::BEGIN@10
1113µs3µsFoswiki::::BEGIN@8Foswiki::BEGIN@8
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
4229µs240µs
# spent 27µs (15+12) within Foswiki::BEGIN@4.77 which was called: # once (15µs+12µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 27µs making 1 call to Foswiki::BEGIN@4.77 # spent 12µs making 1 call to strict::import
5225µs219µs
# spent 14µs (10+5) within Foswiki::BEGIN@5.78 which was called: # once (10µs+5µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 14µs making 1 call to Foswiki::BEGIN@5.78 # spent 5µs making 1 call to warnings::import
6
7220µs14µs
# spent 4µs within Foswiki::BEGIN@7.79 which was called: # once (4µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 7
use Foswiki::Address ();
# spent 4µs making 1 call to Foswiki::BEGIN@7.79
8244µs13µs
# spent 3µs within Foswiki::BEGIN@8 which was called: # once (3µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 8
use Foswiki::Meta ();
# spent 3µs making 1 call to Foswiki::BEGIN@8
9
10
# spent 3µs within Foswiki::BEGIN@10 which was called: # once (3µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 15
BEGIN {
1114µs if ( $Foswiki::cfg{UseLocale} ) {
12 require locale;
13 import locale();
14 }
151237µs13µs}
# spent 3µs making 1 call to Foswiki::BEGIN@10
16
17# See System.VarMETA
18# Before calling, ensure the topicObject is loaded with the version of the
19# topic you intend to display!
20
# spent 9.33ms (515µs+8.81) within Foswiki::META which was called 3 times, avg 3.11ms/call: # 3 times (515µs+8.81ms) by Foswiki::_expandMacroOnTopicRendering at line 3435 of /var/www/foswikidev/core/lib/Foswiki.pm, avg 3.11ms/call
sub META {
2132µs my ( $this, $params, $topicObject ) = @_;
22
2334µs my $option = $params->{_DEFAULT} || '';
2432µs if ( defined( $params->{topic} ) ) {
25 my $addrObj = Foswiki::Address->new(
26 web => $topicObject->web,
27 string => $params->{topic}
28 );
29 if ( !$addrObj->equiv($topicObject) ) {
30 my $meta =
31 new Foswiki::Meta( $this, $addrObj->web, $addrObj->topic );
32 $topicObject = $meta;
33 }
34 }
35
36 # make sure the topicObject is loaded
3738µs38µs my $loadedRev = $topicObject->getLoadedRev();
# spent 8µs making 3 calls to Foswiki::Meta::getLoadedRev, avg 3µs/call
383600ns $topicObject = $topicObject->load() unless defined $loadedRev;
39
40321µs38.72ms if ( $option eq 'form' ) {
# spent 5.92ms making 1 call to Foswiki::Meta::renderFormForDisplay # spent 2.78ms making 1 call to Foswiki::attach # spent 17µs making 1 call to Foswiki::Attach::renderMetaData
41
42 # META:FORM and META:FIELD
43 return $topicObject->renderFormForDisplay();
44 }
45 elsif ( $option eq 'formfield' ) {
46
47 # a formfield from within topic text
48 return $topicObject->renderFormFieldForDisplay(
49 $params->get('name'),
50 Foswiki::isTrue( $params->{display} )
51 ? '$value(display)'
52 : '$value',
53 $params
54 );
55 }
56 elsif ( $option eq 'attachments' ) {
57
58 # renders attachment tables
59 return $this->attach->renderMetaData( $topicObject, $params );
60 }
61 elsif ( $option eq 'moved' ) {
62 require Foswiki::Render::Moved;
63 return Foswiki::Render::Moved::render( $this, $topicObject, $params );
64 }
65 elsif ( $option eq 'parent' ) {
66
67 # Only parent parameter has the format option and should do std escapes
68163µs require Foswiki::Render::Parent;
6916µs233µs return expandStandardEscapes(
# spent 30µs making 1 call to Foswiki::Render::Parent::render # spent 3µs making 1 call to Foswiki::expandStandardEscapes
70 Foswiki::Render::Parent::render( $this, $topicObject, $params ) );
71 }
72
73 # return nothing if invalid parameter
74 return '';
75}
76
7712µs1;
78__END__