← 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/SEARCH.pm
StatementsExecuted 445 statements in 2.62ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
40112.08ms49.6sFoswiki::::SEARCHFoswiki::SEARCH
4011531µs49.6sFoswiki::::__ANON__[:33]Foswiki::__ANON__[:33]
11116µs30µsFoswiki::::BEGIN@4.54Foswiki::BEGIN@4.54
1119µs15µsFoswiki::::BEGIN@5.55Foswiki::BEGIN@5.55
0000s0sFoswiki::::__ANON__[:41]Foswiki::__ANON__[:41]
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
4228µs243µs
# spent 30µs (16+14) within Foswiki::BEGIN@4.54 which was called: # once (16µs+14µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 30µs making 1 call to Foswiki::BEGIN@4.54 # spent 14µs making 1 call to strict::import
52245µs220µs
# spent 15µs (9+6) within Foswiki::BEGIN@5.55 which was called: # once (9µs+6µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 15µs making 1 call to Foswiki::BEGIN@5.55 # spent 6µs making 1 call to warnings::import
6
7
# spent 49.6s (2.08ms+49.6) within Foswiki::SEARCH which was called 40 times, avg 1.24s/call: # 40 times (2.08ms+49.6s) by Foswiki::_expandMacroOnTopicRendering at line 3160 of /var/www/foswiki11/lib/Foswiki.pm, avg 1.24s/call
sub SEARCH {
84035µs my ( $this, $params, $topicObject ) = @_;
9
10 # pass on all attrs, and add some more
11 #$params->{_callback} = undef;
1240119µs4096µs $params->{baseweb} = $topicObject->web;
# spent 96µs making 40 calls to Foswiki::Meta::web, avg 2µs/call
134089µs4085µs $params->{basetopic} = $topicObject->topic;
# spent 85µs making 40 calls to Foswiki::Meta::topic, avg 2µs/call
144070µs $params->{search} = $params->{_DEFAULT} if defined $params->{_DEFAULT};
154019µs $params->{type} = $this->{prefs}->getPreference('SEARCHVARDEFAULTTYPE')
16 unless ( $params->{type} );
17
18#TODO: this is a common default that should be extracted into a 'test, default and refine' parameters for all formatResult calls
194019µs if ( defined( $params->{separator} ) ) {
20 $params->{separator} =
21 Foswiki::expandStandardEscapes( $params->{separator} );
22 }
23
24 # newline feature replaces newlines within each search result
254021µs if ( defined( $params->{newline} ) ) {
26 $params->{newline} =
27 Foswiki::expandStandardEscapes( $params->{newline} );
28 }
29
30407µs my $s;
31
# spent 49.6s (531µs+49.6) within Foswiki::__ANON__[/var/www/foswiki11/lib/Foswiki/Macros/SEARCH.pm:33] which was called 40 times, avg 1.24s/call: # 40 times (531µs+49.6s) by Error::subs::try at line 419 of Error.pm, avg 1.24s/call
try {
3240384µs8049.6s $s = $this->search->searchWeb(%$params);
# spent 49.6s making 40 calls to Foswiki::Search::searchWeb, avg 1.24s/call # spent 11.0ms making 40 calls to Foswiki::search, avg 274µs/call
33 }
34 catch Error::Simple with {
35 my $message = (DEBUG) ? shift->stringify() : shift->{-text};
36
37 # Block recursions kicked off by the text being repeated in the
38 # error message
39 $message =~ s/%([A-Z]*[{%])/%<nop>$1/g;
40 $s = $this->inlineAlert( 'alerts', 'bad_search', $message );
41401.40ms120501µs };
# spent 342µs making 40 calls to Error::catch, avg 9µs/call # spent 159µs making 40 calls to Error::subs::with, avg 4µs/call # spent 49.6s making 40 calls to Error::subs::try, avg 1.24s/call, recursion: max depth 1, sum of overlapping time 49.6s
42
4340180µs return $s;
44}
45
4612µs1;
47__END__