← 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/ADDTOZONE.pm
StatementsExecuted 66 statements in 343µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
51158µs198µsFoswiki::::ADDTOZONEFoswiki::ADDTOZONE
11113µs26µsFoswiki::::BEGIN@4.71Foswiki::BEGIN@4.71
11112µs16µsFoswiki::::BEGIN@5.72Foswiki::BEGIN@5.72
1114µs4µsFoswiki::::BEGIN@7.73Foswiki::BEGIN@7.73
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
4227µs238µs
# spent 26µs (13+13) within Foswiki::BEGIN@4.71 which was called: # once (13µs+13µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 26µs making 1 call to Foswiki::BEGIN@4.71 # spent 13µs making 1 call to strict::import
5246µs220µs
# spent 16µs (12+4) within Foswiki::BEGIN@5.72 which was called: # once (12µs+4µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 16µs making 1 call to Foswiki::BEGIN@5.72 # spent 4µs making 1 call to warnings::import
6
7
# spent 4µs within Foswiki::BEGIN@7.73 which was called: # once (4µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 12
BEGIN {
814µs if ( $Foswiki::cfg{UseLocale} ) {
9 require locale;
10 import locale();
11 }
121209µs14µs}
# spent 4µs making 1 call to Foswiki::BEGIN@7.73
13
14
# spent 198µs (58+140) within Foswiki::ADDTOZONE which was called 5 times, avg 40µs/call: # 5 times (58µs+140µs) by Foswiki::_expandMacroOnTopicRendering at line 3435 of /var/www/foswikidev/core/lib/Foswiki.pm, avg 40µs/call
sub ADDTOZONE {
1553µs my ( $this, $params, $topicObject ) = @_;
16
1753µs my $zones = $params->{_DEFAULT} || $params->{zone} || 'head';
1854µs my $id = $params->{id} || $params->{tag} || '';
1953µs my $topic = $params->{topic} || '';
2051µs my $section = $params->{section} || '';
2152µs my $requires = $params->{requires} || '';
2252µs my $text = $params->{text} || '';
23
24 # when there's a topic or a section parameter, then create an include
25 # this overrides the text parameter
2651µs if ( $topic || $section ) {
27 my $web = $topicObject->web;
28 $topic ||= $topicObject->topic;
29 ( $web, $topic ) = $this->normalizeWebTopicName( $web, $topic );
30
31 # generate TML only and delay expansion until the zone is rendered
32 $text = '%INCLUDE{"' . $web . '.' . $topic . '"';
33 $text .= ' section="' . $section . '"' if $section;
34 $text .= ' warn="off"}%';
35 }
36
3759µs foreach my $zone ( split( /\s*,\s*/, $zones ) ) {
3852µs if ( $zone eq 'body' ) {
39
40#print STDERR "WARNING: ADDTOZONE was called for zone 'body' ... rerouting it to zone 'script' ... please fix your templates\n";
41 $zone = 'script';
42 }
43514µs5140µs $this->addToZone( $zone, $id, $text, $requires );
# spent 140µs making 5 calls to Foswiki::addToZone, avg 28µs/call
44 }
45
46512µs return (DEBUG) ? "<!--A2Z:$id-->" : '';
47}
48
4912µs1;
50__END__