Filename | /var/www/foswiki11/lib/Foswiki/Macros/SEARCH.pm |
Statements | Executed 445 statements in 2.62ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
40 | 1 | 1 | 2.08ms | 49.6s | SEARCH | Foswiki::
40 | 1 | 1 | 531µs | 49.6s | __ANON__[:33] | Foswiki::
1 | 1 | 1 | 16µs | 30µs | BEGIN@4.54 | Foswiki::
1 | 1 | 1 | 9µs | 15µs | BEGIN@5.55 | Foswiki::
0 | 0 | 0 | 0s | 0s | __ANON__[:41] | 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 | 28µs | 2 | 43µ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 # spent 30µs making 1 call to Foswiki::BEGIN@4.54
# spent 14µs making 1 call to strict::import |
5 | 2 | 245µs | 2 | 20µ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 # 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 | ||||
8 | 40 | 35µs | my ( $this, $params, $topicObject ) = @_; | ||
9 | |||||
10 | # pass on all attrs, and add some more | ||||
11 | #$params->{_callback} = undef; | ||||
12 | 40 | 119µs | 40 | 96µs | $params->{baseweb} = $topicObject->web; # spent 96µs making 40 calls to Foswiki::Meta::web, avg 2µs/call |
13 | 40 | 89µs | 40 | 85µs | $params->{basetopic} = $topicObject->topic; # spent 85µs making 40 calls to Foswiki::Meta::topic, avg 2µs/call |
14 | 40 | 70µs | $params->{search} = $params->{_DEFAULT} if defined $params->{_DEFAULT}; | ||
15 | 40 | 19µ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 | ||||
19 | 40 | 19µs | if ( defined( $params->{separator} ) ) { | ||
20 | $params->{separator} = | ||||
21 | Foswiki::expandStandardEscapes( $params->{separator} ); | ||||
22 | } | ||||
23 | |||||
24 | # newline feature replaces newlines within each search result | ||||
25 | 40 | 21µs | if ( defined( $params->{newline} ) ) { | ||
26 | $params->{newline} = | ||||
27 | Foswiki::expandStandardEscapes( $params->{newline} ); | ||||
28 | } | ||||
29 | |||||
30 | 40 | 7µ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 | ||||
32 | 40 | 384µs | 80 | 49.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 ); | ||||
41 | 40 | 1.40ms | 120 | 501µ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 | |||||
43 | 40 | 180µs | return $s; | ||
44 | } | ||||
45 | |||||
46 | 1 | 2µs | 1; | ||
47 | __END__ |