← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 18:42:36 2015
Reported on Fri Jul 31 18:48:16 2015

Filename/var/www/foswikidev/core/lib/Foswiki/Macros/SEARCH.pm
StatementsExecuted 446 statements in 2.73ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
40112.07ms137sFoswiki::::SEARCHFoswiki::SEARCH
4011494µs137sFoswiki::::__ANON__[:40]Foswiki::__ANON__[:40]
11117µs31µsFoswiki::::BEGIN@4.87Foswiki::BEGIN@4.87
11110µs14µsFoswiki::::BEGIN@5.88Foswiki::BEGIN@5.88
1115µs5µsFoswiki::::BEGIN@7.89Foswiki::BEGIN@7.89
0000s0sFoswiki::::__ANON__[:60]Foswiki::__ANON__[:60]
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
4230µs244µs
# spent 31µs (17+13) within Foswiki::BEGIN@4.87 which was called: # once (17µs+13µs) by Foswiki::_expandMacroOnTopicRendering at line 4
use strict;
# spent 31µs making 1 call to Foswiki::BEGIN@4.87 # spent 13µs making 1 call to strict::import
5249µs219µs
# spent 14µs (10+5) within Foswiki::BEGIN@5.88 which was called: # once (10µs+5µs) by Foswiki::_expandMacroOnTopicRendering at line 5
use warnings;
# spent 14µs making 1 call to Foswiki::BEGIN@5.88 # spent 5µs making 1 call to warnings::import
6
7
# spent 5µs within Foswiki::BEGIN@7.89 which was called: # once (5µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 12
BEGIN {
815µs if ( $Foswiki::cfg{UseLocale} ) {
9 require locale;
10 import locale();
11 }
121299µs15µs}
# spent 5µs making 1 call to Foswiki::BEGIN@7.89
13
14
# spent 137s (2.07ms+137) within Foswiki::SEARCH which was called 40 times, avg 3.42s/call: # 40 times (2.07ms+137s) by Foswiki::_expandMacroOnTopicRendering at line 3435 of /var/www/foswikidev/core/lib/Foswiki.pm, avg 3.42s/call
sub SEARCH {
154048µs my ( $this, $params, $topicObject ) = @_;
16
17 # pass on all attrs, and add some more
18 #$params->{_callback} = undef;
1940111µs4093µs $params->{baseweb} = $topicObject->web;
# spent 93µs making 40 calls to Foswiki::Meta::web, avg 2µs/call
204084µs4071µs $params->{basetopic} = $topicObject->topic;
# spent 71µs making 40 calls to Foswiki::Meta::topic, avg 2µs/call
214077µs $params->{search} = $params->{_DEFAULT} if defined $params->{_DEFAULT};
224021µs $params->{type} = $this->{prefs}->getPreference('SEARCHVARDEFAULTTYPE')
23 unless ( $params->{type} );
24
25#TODO: this is a common default that should be extracted into a 'test, default and refine' parameters for all formatResult calls
264017µs if ( defined( $params->{separator} ) ) {
27 $params->{separator} =
28 Foswiki::expandStandardEscapes( $params->{separator} );
29 }
30
31 # newline feature replaces newlines within each search result
324026µs if ( defined( $params->{newline} ) ) {
33 $params->{newline} =
34 Foswiki::expandStandardEscapes( $params->{newline} );
35 }
36
37409µs my $s;
38
# spent 137s (494µs+137) within Foswiki::__ANON__[/var/www/foswikidev/core/lib/Foswiki/Macros/SEARCH.pm:40] which was called 40 times, avg 3.42s/call: # 40 times (494µs+137s) by Error::subs::try at line 419 of Error.pm, avg 3.42s/call
try {
3940400µs80137s $s = $this->search->searchWeb(%$params);
# spent 137s making 40 calls to Foswiki::Search::searchWeb, avg 3.42s/call # spent 65µs making 40 calls to Foswiki::search, avg 2µs/call
40 }
41 catch Error with {
42 my $exception = shift;
43 my $message;
44
45 if (DEBUG) {
46 $message = $exception->stringify();
47 }
48 else {
49 $message = $exception->{-text};
50 my @lines = split( /\n/, $message );
51 $message = $lines[0];
52 $message =~ s/ at .*? line \d+\.?$//;
53 }
54
55 # Block recursions kicked off by the text being repeated in the
56 # error message
57 $message =~ s/%([A-Z]*[{%])/%<nop>$1/g;
58 $message =~ s/\n/<br \/>/g;
59 $s = $this->inlineAlert( 'alerts', 'bad_search', $message );
60401.33ms120525µs };
# spent 338µs making 40 calls to Error::catch, avg 8µs/call # spent 188µs making 40 calls to Error::subs::with, avg 5µs/call # spent 137s making 40 calls to Error::subs::try, avg 3.42s/call, recursion: max depth 1, sum of overlapping time 137s
6140224µs return $s;
62}
63
6413µs1;
65__END__