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

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/ADDTOHEAD.pm
StatementsExecuted 15 statements in 463µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11154µs76µsFoswiki::::BEGIN@5.49Foswiki::BEGIN@5.49
11130µs38µsFoswiki::::BEGIN@4.48Foswiki::BEGIN@4.48
11127µs88µsFoswiki::::ADDTOHEADFoswiki::ADDTOHEAD
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
4252µs247µs
# spent 38µs (30+9) within Foswiki::BEGIN@4.48 which was called: # once (30µs+9µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 38µs making 1 call to Foswiki::BEGIN@4.48 # spent 9µs making 1 call to strict::import
52377µs297µs
# spent 76µs (54+21) within Foswiki::BEGIN@5.49 which was called: # once (54µs+21µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 76µs making 1 call to Foswiki::BEGIN@5.49 # spent 21µs making 1 call to warnings::import
6
7
# spent 88µs (27+61) within Foswiki::ADDTOHEAD which was called: # once (27µs+61µs) by Foswiki::_expandMacroOnTopicRendering at line 3066 of /usr/local/src/github.com/foswiki/core/lib/Foswiki.pm
sub ADDTOHEAD {
81029µs my ( $this, $args, $topicObject ) = @_;
9
10 my $_DEFAULT = $args->{_DEFAULT};
11 my $text = $args->{text};
12 my $topic = $args->{topic};
13 my $requires = $args->{requires};
14 if ( defined $args->{topic} ) {
15 my ( $web, $topic ) =
16 $this->normalizeWebTopicName( $topicObject->web, $args->{topic} );
17
18 # prevent deep recursion
19 $web =~ s/\//\./g; # SMELL: unnecessary?
20 unless ( $this->{_addedToHEAD}{"$web.$topic"} ) {
21 my $atom = Foswiki::Meta->load( $this, $web, $topic );
22 $text = $atom->text();
23 $this->{_addedToHEAD}{"$web.$topic"} = 1;
24 }
25 }
26 $text = $_DEFAULT unless defined $text;
27 $text = '' unless defined $text;
28
29161µs $this->addToZone( 'head', $_DEFAULT, $text, $requires );
# spent 61µs making 1 call to Foswiki::addToZone
30 return '';
31}
32
3315µs1;
34__END__