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

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/ADDTOZONE.pm
StatementsExecuted 55 statements in 617µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
411152µs385µsFoswiki::::ADDTOZONEFoswiki::ADDTOZONE
11132µs40µsFoswiki::::BEGIN@4.25Foswiki::BEGIN@4.25
11120µs66µsFoswiki::::BEGIN@7Foswiki::BEGIN@7
11117µs37µsFoswiki::::BEGIN@5.26Foswiki::BEGIN@5.26
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
4247µs248µs
# spent 40µs (32+8) within Foswiki::BEGIN@4.25 which was called: # once (32µs+8µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 40µs making 1 call to Foswiki::BEGIN@4.25 # spent 8µs making 1 call to strict::import
5246µs256µs
# spent 37µs (17+19) within Foswiki::BEGIN@5.26 which was called: # once (17µs+19µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 37µs making 1 call to Foswiki::BEGIN@5.26 # spent 19µs making 1 call to warnings::import
6
72374µs2111µs
# spent 66µs (20+45) within Foswiki::BEGIN@7 which was called: # once (20µs+45µs) by Foswiki::_expandMacroOnTopicRendering at line 7
use Assert;
# spent 66µs making 1 call to Foswiki::BEGIN@7 # spent 45µs making 1 call to Assert::import
8
9
# spent 385µs (152+234) within Foswiki::ADDTOZONE which was called 4 times, avg 96µs/call: # 4 times (152µs+234µs) by Foswiki::_expandMacroOnTopicRendering at line 3066 of /usr/local/src/github.com/foswiki/core/lib/Foswiki.pm, avg 96µs/call
sub ADDTOZONE {
1040105µs my ( $this, $params, $topicObject ) = @_;
11
12 my $zones = $params->{_DEFAULT} || $params->{zone} || 'head';
13 my $id = $params->{id} || $params->{tag} || '';
14 my $topic = $params->{topic} || '';
15 my $section = $params->{section} || '';
16 my $requires = $params->{requires} || '';
17 my $text = $params->{text} || '';
18
19 # when there's a topic or a section parameter, then create an include
20 # this overrides the text parameter
21 if ( $topic || $section ) {
22 my $web = $topicObject->web;
23 $topic ||= $topicObject->topic;
24 ( $web, $topic ) = $this->normalizeWebTopicName( $web, $topic );
25
26 # generate TML only and delay expansion until the zone is rendered
27 $text = '%INCLUDE{"' . $web . '.' . $topic . '"';
28 $text .= ' section="' . $section . '"' if $section;
29 $text .= ' warn="off"}%';
30 }
31
32 foreach my $zone ( split( /\s*,\s*/, $zones ) ) {
33840µs if ( $zone eq 'body' ) {
34
35#print STDERR "WARNING: ADDTOZONE was called for zone 'body' ... rerouting it to zone 'script' ... please fix your templates\n";
36 $zone = 'script';
37 }
384218µs $this->addToZone( $zone, $id, $text, $requires );
# spent 218µs making 4 calls to Foswiki::addToZone, avg 54µs/call
39 }
40
41416µs return (DEBUG) ? "<!--A2Z:$id-->" : '';
# spent 16µs making 4 calls to Assert::ASSERTS_OFF, avg 4µs/call
42}
43
4414µs1;
45__END__