← 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/ADDTOZONE.pm
StatementsExecuted 55 statements in 575µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41191µs224µsFoswiki::::ADDTOZONEFoswiki::ADDTOZONE
11125µs49µsFoswiki::::BEGIN@4.40Foswiki::BEGIN@4.40
11116µs25µsFoswiki::::BEGIN@5.41Foswiki::BEGIN@5.41
11115µs37µsFoswiki::::BEGIN@7.42Foswiki::BEGIN@7.42
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
4249µs273µs
# spent 49µs (25+24) within Foswiki::BEGIN@4.40 which was called: # once (25µs+24µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 49µs making 1 call to Foswiki::BEGIN@4.40 # spent 24µs making 1 call to strict::import
5247µs235µs
# spent 25µs (16+10) within Foswiki::BEGIN@5.41 which was called: # once (16µs+10µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 25µs making 1 call to Foswiki::BEGIN@5.41 # spent 10µs making 1 call to warnings::import
6
72399µs259µs
# spent 37µs (15+22) within Foswiki::BEGIN@7.42 which was called: # once (15µs+22µs) by Foswiki::_expandMacroOnTopicRendering at line 7
use Assert;
# spent 37µs making 1 call to Foswiki::BEGIN@7.42 # spent 22µs making 1 call to Assert::import
8
9
# spent 224µs (91+133) within Foswiki::ADDTOZONE which was called 4 times, avg 56µs/call: # 4 times (91µs+133µs) by Foswiki::_expandMacroOnTopicRendering at line 3160 of /var/www/foswiki11/lib/Foswiki.pm, avg 56µs/call
sub ADDTOZONE {
1043µs my ( $this, $params, $topicObject ) = @_;
11
1244µs my $zones = $params->{_DEFAULT} || $params->{zone} || 'head';
1342µs my $id = $params->{id} || $params->{tag} || '';
1443µs my $topic = $params->{topic} || '';
1543µs my $section = $params->{section} || '';
1643µs my $requires = $params->{requires} || '';
1742µs 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
2142µs 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
32410µs foreach my $zone ( split( /\s*,\s*/, $zones ) ) {
3342µ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 }
38416µs4124µs $this->addToZone( $zone, $id, $text, $requires );
# spent 124µs making 4 calls to Foswiki::addToZone, avg 31µs/call
39 }
40
41425µs49µs return (DEBUG) ? "<!--A2Z:$id-->" : '';
# spent 9µs making 4 calls to Assert::ASSERTS_OFF, avg 2µs/call
42}
43
4414µs1;
45__END__