Filename | /var/www/foswikidev/core/lib/Foswiki/Macros/SEARCH.pm |
Statements | Executed 446 statements in 2.73ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
40 | 1 | 1 | 2.07ms | 137s | SEARCH | Foswiki::
40 | 1 | 1 | 494µs | 137s | __ANON__[:40] | Foswiki::
1 | 1 | 1 | 17µs | 31µs | BEGIN@4.87 | Foswiki::
1 | 1 | 1 | 10µs | 14µs | BEGIN@5.88 | Foswiki::
1 | 1 | 1 | 5µs | 5µs | BEGIN@7.89 | Foswiki::
0 | 0 | 0 | 0s | 0s | __ANON__[:60] | 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 | 30µs | 2 | 44µ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 # spent 31µs making 1 call to Foswiki::BEGIN@4.87
# spent 13µs making 1 call to strict::import |
5 | 2 | 49µs | 2 | 19µ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 # 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 | ||||
8 | 1 | 5µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
9 | require locale; | ||||
10 | import locale(); | ||||
11 | } | ||||
12 | 1 | 299µs | 1 | 5µ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 | ||||
15 | 40 | 48µs | my ( $this, $params, $topicObject ) = @_; | ||
16 | |||||
17 | # pass on all attrs, and add some more | ||||
18 | #$params->{_callback} = undef; | ||||
19 | 40 | 111µs | 40 | 93µs | $params->{baseweb} = $topicObject->web; # spent 93µs making 40 calls to Foswiki::Meta::web, avg 2µs/call |
20 | 40 | 84µs | 40 | 71µs | $params->{basetopic} = $topicObject->topic; # spent 71µs making 40 calls to Foswiki::Meta::topic, avg 2µs/call |
21 | 40 | 77µs | $params->{search} = $params->{_DEFAULT} if defined $params->{_DEFAULT}; | ||
22 | 40 | 21µ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 | ||||
26 | 40 | 17µs | if ( defined( $params->{separator} ) ) { | ||
27 | $params->{separator} = | ||||
28 | Foswiki::expandStandardEscapes( $params->{separator} ); | ||||
29 | } | ||||
30 | |||||
31 | # newline feature replaces newlines within each search result | ||||
32 | 40 | 26µs | if ( defined( $params->{newline} ) ) { | ||
33 | $params->{newline} = | ||||
34 | Foswiki::expandStandardEscapes( $params->{newline} ); | ||||
35 | } | ||||
36 | |||||
37 | 40 | 9µ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 | ||||
39 | 40 | 400µs | 80 | 137s | $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 ); | ||||
60 | 40 | 1.33ms | 120 | 525µ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 |
61 | 40 | 224µs | return $s; | ||
62 | } | ||||
63 | |||||
64 | 1 | 3µs | 1; | ||
65 | __END__ |