Filename | /var/www/foswiki11/lib/Foswiki/Macros/ADDTOZONE.pm |
Statements | Executed 55 statements in 575µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4 | 1 | 1 | 91µs | 224µs | ADDTOZONE | Foswiki::
1 | 1 | 1 | 25µs | 49µs | BEGIN@4.40 | Foswiki::
1 | 1 | 1 | 16µs | 25µs | BEGIN@5.41 | Foswiki::
1 | 1 | 1 | 15µs | 37µs | BEGIN@7.42 | Foswiki::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | package Foswiki; | ||||
3 | |||||
4 | 2 | 49µs | 2 | 73µ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 # spent 49µs making 1 call to Foswiki::BEGIN@4.40
# spent 24µs making 1 call to strict::import |
5 | 2 | 47µs | 2 | 35µ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 # spent 25µs making 1 call to Foswiki::BEGIN@5.41
# spent 10µs making 1 call to warnings::import |
6 | |||||
7 | 2 | 399µs | 2 | 59µ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 # 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 | ||||
10 | 4 | 3µs | my ( $this, $params, $topicObject ) = @_; | ||
11 | |||||
12 | 4 | 4µs | my $zones = $params->{_DEFAULT} || $params->{zone} || 'head'; | ||
13 | 4 | 2µs | my $id = $params->{id} || $params->{tag} || ''; | ||
14 | 4 | 3µs | my $topic = $params->{topic} || ''; | ||
15 | 4 | 3µs | my $section = $params->{section} || ''; | ||
16 | 4 | 3µs | my $requires = $params->{requires} || ''; | ||
17 | 4 | 2µ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 | ||||
21 | 4 | 2µ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 | |||||
32 | 4 | 10µs | foreach my $zone ( split( /\s*,\s*/, $zones ) ) { | ||
33 | 4 | 2µ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 | } | ||||
38 | 4 | 16µs | 4 | 124µs | $this->addToZone( $zone, $id, $text, $requires ); # spent 124µs making 4 calls to Foswiki::addToZone, avg 31µs/call |
39 | } | ||||
40 | |||||
41 | 4 | 25µs | 4 | 9µs | return (DEBUG) ? "<!--A2Z:$id-->" : ''; # spent 9µs making 4 calls to Assert::ASSERTS_OFF, avg 2µs/call |
42 | } | ||||
43 | |||||
44 | 1 | 4µs | 1; | ||
45 | __END__ |