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

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugin.pm
StatementsExecuted 43578 statements in 173ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1031611137ms367msFoswiki::Plugin::::invokeFoswiki::Plugin::invoke (recurses: max depth 1, inclusive time 559µs)
19116.82ms81.2sFoswiki::Plugin::::registerHandlersFoswiki::Plugin::registerHandlers
19113.05ms44.3msFoswiki::Plugin::::loadFoswiki::Plugin::load
1111.49ms1.62msFoswiki::Plugin::::BEGIN@15Foswiki::Plugin::BEGIN@15
1911575µs81.2sFoswiki::Plugin::::__ANON__[:235]Foswiki::Plugin::__ANON__[:235]
111501µs577µsFoswiki::Plugin::::BEGIN@14Foswiki::Plugin::BEGIN@14
1911469µs545µsFoswiki::Plugin::::newFoswiki::Plugin::new
1911384µs384µsFoswiki::Plugin::::finishFoswiki::Plugin::finish
111329µs405µsFoswiki::Plugin::::BEGIN@16Foswiki::Plugin::BEGIN@16
1911181µs181µsFoswiki::Plugin::::topicWebFoswiki::Plugin::topicWeb
1911158µs158µsFoswiki::Plugin::::registerSettingsFoswiki::Plugin::registerSettings
11125µs32µsFoswiki::Plugin::::BEGIN@8Foswiki::Plugin::BEGIN@8
11124µs60µsFoswiki::Plugin::::BEGIN@176Foswiki::Plugin::BEGIN@176
11123µs58µsFoswiki::Plugin::::BEGIN@10Foswiki::Plugin::BEGIN@10
11120µs49µsFoswiki::Plugin::::BEGIN@306Foswiki::Plugin::BEGIN@306
11119µs48µsFoswiki::Plugin::::BEGIN@189Foswiki::Plugin::BEGIN@189
11117µs469µsFoswiki::Plugin::::BEGIN@11Foswiki::Plugin::BEGIN@11
11117µs48µsFoswiki::Plugin::::BEGIN@286Foswiki::Plugin::BEGIN@286
11116µs34µsFoswiki::Plugin::::BEGIN@9Foswiki::Plugin::BEGIN@9
11116µs43µsFoswiki::Plugin::::BEGIN@296Foswiki::Plugin::BEGIN@296
11116µs44µsFoswiki::Plugin::::BEGIN@288Foswiki::Plugin::BEGIN@288
11116µs45µsFoswiki::Plugin::::BEGIN@227Foswiki::Plugin::BEGIN@227
11115µs45µsFoswiki::Plugin::::BEGIN@178Foswiki::Plugin::BEGIN@178
11115µs44µsFoswiki::Plugin::::BEGIN@234Foswiki::Plugin::BEGIN@234
11115µs43µsFoswiki::Plugin::::BEGIN@308Foswiki::Plugin::BEGIN@308
11115µs43µsFoswiki::Plugin::::BEGIN@298Foswiki::Plugin::BEGIN@298
11115µs43µsFoswiki::Plugin::::BEGIN@195Foswiki::Plugin::BEGIN@195
11111µs11µsFoswiki::Plugin::::BEGIN@13Foswiki::Plugin::BEGIN@13
0000s0sFoswiki::Plugin::::__ANON__[:238]Foswiki::Plugin::__ANON__[:238]
0000s0sFoswiki::Plugin::::__ANON__[:241]Foswiki::Plugin::__ANON__[:241]
0000s0sFoswiki::Plugin::::__ANON__[:244]Foswiki::Plugin::__ANON__[:244]
0000s0sFoswiki::Plugin::::__ANON__[:248]Foswiki::Plugin::__ANON__[:248]
0000s0sFoswiki::Plugin::::getDescriptionFoswiki::Plugin::getDescription
0000s0sFoswiki::Plugin::::getReleaseFoswiki::Plugin::getRelease
0000s0sFoswiki::Plugin::::getVersionFoswiki::Plugin::getVersion
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
2
3# PRIVATE CLASS Foswiki::Plugin
4#
5# Reference information for a single plugin.
6package Foswiki::Plugin;
7
8251µs240µs
# spent 32µs (25+7) within Foswiki::Plugin::BEGIN@8 which was called: # once (25µs+7µs) by Foswiki::Plugins::BEGIN@21 at line 8
use strict;
# spent 32µs making 1 call to Foswiki::Plugin::BEGIN@8 # spent 7µs making 1 call to strict::import
9247µs252µs
# spent 34µs (16+18) within Foswiki::Plugin::BEGIN@9 which was called: # once (16µs+18µs) by Foswiki::Plugins::BEGIN@21 at line 9
use warnings;
# spent 34µs making 1 call to Foswiki::Plugin::BEGIN@9 # spent 18µs making 1 call to warnings::import
10251µs294µs
# spent 58µs (23+35) within Foswiki::Plugin::BEGIN@10 which was called: # once (23µs+35µs) by Foswiki::Plugins::BEGIN@21 at line 10
use Assert;
# spent 58µs making 1 call to Foswiki::Plugin::BEGIN@10 # spent 35µs making 1 call to Assert::import
11255µs2920µs
# spent 469µs (17+451) within Foswiki::Plugin::BEGIN@11 which was called: # once (17µs+451µs) by Foswiki::Plugins::BEGIN@21 at line 11
use Error qw(:try);
# spent 469µs making 1 call to Foswiki::Plugin::BEGIN@11 # spent 451µs making 1 call to Error::import
12
13244µs111µs
# spent 11µs within Foswiki::Plugin::BEGIN@13 which was called: # once (11µs+0s) by Foswiki::Plugins::BEGIN@21 at line 13
use Foswiki::Plugins ();
# spent 11µs making 1 call to Foswiki::Plugin::BEGIN@13
142332µs1577µs
# spent 577µs (501+76) within Foswiki::Plugin::BEGIN@14 which was called: # once (501µs+76µs) by Foswiki::Plugins::BEGIN@21 at line 14
use Foswiki::AccessControlException ();
# spent 577µs making 1 call to Foswiki::Plugin::BEGIN@14
152225µs11.62ms
# spent 1.62ms (1.49+132µs) within Foswiki::Plugin::BEGIN@15 which was called: # once (1.49ms+132µs) by Foswiki::Plugins::BEGIN@21 at line 15
use Foswiki::OopsException ();
# spent 1.62ms making 1 call to Foswiki::Plugin::BEGIN@15
162893µs1405µs
# spent 405µs (329+76) within Foswiki::Plugin::BEGIN@16 which was called: # once (329µs+76µs) by Foswiki::Plugins::BEGIN@21 at line 16
use Foswiki::ValidationException ();
# spent 405µs making 1 call to Foswiki::Plugin::BEGIN@16
17
1818µsour @registrableHandlers = ( # Foswiki::Plugins::VERSION:
19 'afterAttachmentSaveHandler', # 1.022 DEPRECATED
20 'afterUploadHandler', # 2.1
21 'afterCommonTagsHandler', # 1.024
22 'afterEditHandler', # 1.010
23 'afterRenameHandler', # 1.110
24 'afterSaveHandler', # 1.020
25 'beforeAttachmentSaveHandler', # 1.022 DEPRECATED
26 'beforeCommonTagsHandler', # 1.024
27 'beforeEditHandler', # 1.010
28 'beforeMergeHandler', # 1.200
29 'beforeSaveHandler', # 1.010
30 'beforeUploadHandler', # 2.1
31 'commonTagsHandler', # 1.000
32 'completePageHandler', # 1.100
33 'earlyInitPlugin', # 1.020
34 'endRenderingHandler', # 1.000 DEPRECATED
35 'finishPlugin', # 2.100
36 'initPlugin', # 1.000
37 'initializeUserHandler', # 1.010
38 'insidePREHandler', # 1.000 DEPRECATED
39 'modifyHeaderHandler', # 1.026
40 'mergeHandler', # 1.026
41 'outsidePREHandler', # 1.000 DEPRECATED
42 'postRenderingHandler', # 1.026
43 'preRenderingHandler', # 1.026
44 'redirectCgiQueryHandler', # 1.010 DEPRECATED
45 'registrationHandler', # 1.010
46 'renderFormFieldForEditHandler', # ?
47 'renderWikiWordHandler', # 1.023
48 'startRenderingHandler', # 1.000 DEPRECATED
49 'writeHeaderHandler', # 1.010 DEPRECATED
50);
51
52# deprecated handlers
5317µsour %deprecated = (
54 afterAttachmentSaveHandler => 1,
55 beforeAttachmentSaveHandler => 1,
56 endRenderingHandler => 1,
57 insidePREHandler => 1,
58 outsidePREHandler => 1,
59 redirectCgiQueryHandler => 1,
60 startRenderingHandler => 1,
61 writeHeaderHandler => 1,
62);
63
64=begin TML
65
66---++ ClassMethod new( $session, $name, [, $module] )
67
68 * =$session= - Foswiki object
69 * =$name= - name of the plugin e.g. MyPlugin
70 * =$module= - name of implementing package; optional, used for tests.
71 Normally =load= is used to discover the module from the config.
72
73=cut
74
75
# spent 545µs (469+75) within Foswiki::Plugin::new which was called 19 times, avg 29µs/call: # 19 times (469µs+75µs) by Foswiki::Plugins::load at line 183 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 29µs/call
sub new {
7676446µs my ( $class, $session, $name, $module ) = @_;
771975µs ASSERT( UNTAINTED($name), "Name $name is tainted!" ) if DEBUG;
# spent 75µs making 19 calls to Assert::ASSERTS_OFF, avg 4µs/call
78 my $this = bless(
79 {
80 session => $session,
81 name => $name || '',
82 module => $module, # if undef, use discovery
83 },
84 $class
85 );
86
87 return $this;
88}
89
90=begin TML
91
92---++ ObjectMethod finish()
93Break circular references.
94
95=cut
96
97# Note to developers; please undef *all* fields in the object explicitly,
98# whether they are references or not. That way this method is "golden
99# documentation" of the live fields in the object.
100
# spent 384µs within Foswiki::Plugin::finish which was called 19 times, avg 20µs/call: # 19 times (384µs+0s) by Foswiki::Plugins::finish at line 98 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 20µs/call
sub finish {
101171407µs my $this = shift;
102
103 undef $this->{name};
104 undef $this->{topicWeb};
105 undef $this->{module};
106 undef $this->{errors};
107 undef $this->{disabled};
108 undef $this->{no_topic};
109 undef $this->{description};
110 undef $this->{session};
111}
112
113# Load and verify a plugin, invoking any early registration
114# handlers. Return the user resulting from the user handler call.
115
# spent 44.3ms (3.05+41.3) within Foswiki::Plugin::load which was called 19 times, avg 2.33ms/call: # 19 times (3.05ms+41.3ms) by Foswiki::Plugins::load at line 186 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 2.33ms/call
sub load {
1163231.72ms my ($this) = @_;
117 my $p = $Foswiki::cfg{Plugins}{ $this->{name} }{Module};
118
119381.02ms if ( defined $p ) {
120 eval "use $p";
# spent 292µs executing statements in 2 string evals (merged)
# includes 1.98ms spent executing 2 calls to 2 subs defined therein. # spent 213µs executing statements in string eval
# includes 3.29ms spent executing 1 call to 1 sub defined therein. # spent 176µs executing statements in string eval
# includes 854µs spent executing 1 call to 1 sub defined therein. # spent 175µs executing statements in string eval
# includes 2.76ms spent executing 1 call to 1 sub defined therein. # spent 171µs executing statements in string eval
# includes 1.58ms spent executing 1 call to 1 sub defined therein. # spent 169µs executing statements in string eval
# includes 2.85ms spent executing 1 call to 1 sub defined therein. # spent 161µs executing statements in string eval
# includes 649µs spent executing 1 call to 1 sub defined therein. # spent 157µs executing statements in string eval
# includes 2.64ms spent executing 1 call to 1 sub defined therein. # spent 156µs executing statements in string eval
# includes 1.43ms spent executing 1 call to 1 sub defined therein. # spent 151µs executing statements in string eval
# includes 2.71ms spent executing 1 call to 1 sub defined therein. # spent 150µs executing statements in string eval
# includes 3.82ms spent executing 1 call to 1 sub defined therein. # spent 145µs executing statements in string eval
# includes 1.30ms spent executing 1 call to 1 sub defined therein. # spent 144µs executing statements in string eval
# includes 2.03ms spent executing 1 call to 1 sub defined therein. # spent 142µs executing statements in string eval
# includes 1.43ms spent executing 1 call to 1 sub defined therein. # spent 141µs executing statements in string eval
# includes 599µs spent executing 1 call to 1 sub defined therein. # spent 140µs executing statements in string eval
# includes 1.78ms spent executing 1 call to 1 sub defined therein. # spent 138µs executing statements in string eval
# includes 525µs spent executing 1 call to 1 sub defined therein. # spent 133µs executing statements in string eval
# includes 1.78ms spent executing 1 call to 1 sub defined therein.
1211955µs if ($@) {
122 push(
123 @{ $this->{errors} },
124 "$p could not be loaded. Errors were:\n$@\n----"
125 );
126 $this->{disabled} = 1;
127 return;
128 }
129 else {
130 $this->{module} = $p;
131 }
132 }
133 else {
134 push(
135 @{ $this->{errors} },
136"$this->{name} could not be loaded. No \$Foswiki::cfg{Plugins}{$this->{name}}{Module} defined - re-run configure\n---"
137 );
138 $this->{disabled} = 1;
139 return;
140 }
141
142 my $noTopic = eval '$' . $p . '::NO_PREFS_IN_TOPIC';
# spent 8µs executing statements in 2 string evals (merged) # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval
143 $this->{no_topic} = $noTopic;
144 $this->{topicWeb} = undef; # not known yet
145
146 unless ($noTopic) {
147 if ( !$this->topicWeb() ) {
148
149 # not found
150 push(
151 @{ $this->{errors} },
152 'Plugins: could not fully register '
153 . $this->{name}
154 . ', no plugin topic'
155 );
156 $noTopic = 1;
157 }
158 }
159
160 # Get the description from the code, if present. if it's not there, it'll
161 # be loaded as a preference from the plugin topic later
162 $this->{description} = eval '$' . $p . '::SHORTDESCRIPTION';
# spent 8µs executing statements in 2 string evals (merged) # spent 5µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 3µs executing statements in string eval
163
164 # Set the session for this call stack
165 local $Foswiki::Plugins::SESSION = $this->{session};
166
167 my $sub = $p . "::initPlugin";
168 if ( !defined(&$sub) ) {
169 push( @{ $this->{errors} }, $sub . ' is not defined' );
170 $this->{disabled} = 1;
171 return;
172 }
173
174 $sub = $p . '::earlyInitPlugin';
175 if ( defined(&$sub) ) {
176260µs297µs
# spent 60µs (24+36) within Foswiki::Plugin::BEGIN@176 which was called: # once (24µs+36µs) by Foswiki::Plugins::BEGIN@21 at line 176
no strict 'refs';
# spent 60µs making 1 call to Foswiki::Plugin::BEGIN@176 # spent 36µs making 1 call to strict::unimport
177 my $error = &$sub();
1782127µs274µs
# spent 45µs (15+29) within Foswiki::Plugin::BEGIN@178 which was called: # once (15µs+29µs) by Foswiki::Plugins::BEGIN@21 at line 178
use strict 'refs';
# spent 45µs making 1 call to Foswiki::Plugin::BEGIN@178 # spent 29µs making 1 call to strict::import
179 if ($error) {
180 push( @{ $this->{errors} }, $sub . ' failed: ' . $error );
181 $this->{disabled} = 1;
182 return;
183 }
184 }
185
186 my $user;
187 $sub = $p . '::initializeUserHandler';
188 if ( defined(&$sub) ) {
189281µs278µs
# spent 48µs (19+29) within Foswiki::Plugin::BEGIN@189 which was called: # once (19µs+29µs) by Foswiki::Plugins::BEGIN@21 at line 189
no strict 'refs';
# spent 48µs making 1 call to Foswiki::Plugin::BEGIN@189 # spent 29µs making 1 call to strict::unimport
190 $user = &$sub(
191 $this->{session}->{remoteUser},
192 $this->{session}->{request}->url(),
193 $this->{session}->{request}->path_info()
194 );
1952297µs271µs
# spent 43µs (15+28) within Foswiki::Plugin::BEGIN@195 which was called: # once (15µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 195
use strict 'refs';
# spent 43µs making 1 call to Foswiki::Plugin::BEGIN@195 # spent 28µs making 1 call to strict::import
196 }
197
198 #print STDERR "Compile $p: ".timestr(timediff(new Benchmark, $begin))."\n";
199
200 return $user;
201}
202
203# register plugin settings
204
# spent 158µs within Foswiki::Plugin::registerSettings which was called 19 times, avg 8µs/call: # 19 times (158µs+0s) by Foswiki::Plugins::settings at line 229 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 8µs/call
sub registerSettings {
20576181µs my ( $this, $plugins ) = @_;
206
207 return if $this->{disabled};
208
209 my $prefs = $this->{session}->{prefs};
210 if ( !$this->{no_topic} ) {
211 $prefs->setPluginPreferences( $this->topicWeb(), $this->{name} );
212 }
213}
214
215# invoke plugin initialisation and register handlers.
216
# spent 81.2s (6.82ms+81.2) within Foswiki::Plugin::registerHandlers which was called 19 times, avg 4.27s/call: # 19 times (6.82ms+81.2s) by Foswiki::Plugins::enable at line 259 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 4.27s/call
sub registerHandlers {
2172282.88ms my ( $this, $plugins ) = @_;
218
219 return if $this->{disabled};
220
221 my $p = $this->{module};
222 my $sub = $p . "::initPlugin";
223 my $users = $Foswiki::Plugins::SESSION->{users};
224 my $status = 0;
225 my $exception = '';
226
# spent 81.2s (575µs+81.2) within Foswiki::Plugin::__ANON__[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugin.pm:235] which was called 19 times, avg 4.27s/call: # 19 times (575µs+81.2s) by Error::subs::try at line 416 of Error.pm, avg 4.27s/call
try {
227299µs274µs
# spent 45µs (16+29) within Foswiki::Plugin::BEGIN@227 which was called: # once (16µs+29µs) by Foswiki::Plugins::BEGIN@21 at line 227
no strict 'refs';
# spent 45µs making 1 call to Foswiki::Plugin::BEGIN@227 # spent 29µs making 1 call to strict::unimport
22819579µs5781.2s $status = &$sub(
# spent 60.9s making 1 call to Foswiki::Plugins::InterwikiPlugin::initPlugin # spent 20.3s making 1 call to Foswiki::Plugins::SmiliesPlugin::initPlugin # spent 9.16ms making 1 call to Foswiki::Plugins::JQueryPlugin::initPlugin # spent 3.23ms making 1 call to Foswiki::Plugins::CommentPlugin::initPlugin # spent 1.04ms making 1 call to Foswiki::Plugins::TwistyPlugin::initPlugin # spent 745µs making 19 calls to Foswiki::Users::getLoginName, avg 39µs/call # spent 583µs making 1 call to Foswiki::Plugins::WysiwygPlugin::initPlugin # spent 491µs making 1 call to Foswiki::Plugins::TinyMCEPlugin::initPlugin # spent 359µs making 1 call to Foswiki::Plugins::SpreadSheetPlugin::initPlugin # spent 300µs making 1 call to Foswiki::Plugins::EditTablePlugin::initPlugin # spent 273µs making 1 call to Foswiki::Plugins::AutoViewTemplatePlugin::initPlugin # spent 195µs making 1 call to Foswiki::Plugins::TablePlugin::initPlugin # spent 181µs making 19 calls to Foswiki::Plugin::topicWeb, avg 10µs/call # spent 114µs making 1 call to Foswiki::Plugins::SubscribePlugin::initPlugin # spent 97µs making 1 call to Foswiki::Plugins::MailerContribPlugin::initPlugin # spent 81µs making 1 call to Foswiki::Plugins::HistoryPlugin::initPlugin # spent 80µs making 1 call to Foswiki::Plugins::UpdatesPlugin::initPlugin # spent 70µs making 1 call to Foswiki::Plugins::RenderListPlugin::initPlugin # spent 21µs making 1 call to Foswiki::Plugins::SlideShowPlugin::initPlugin # spent 18µs making 1 call to Foswiki::Plugins::PreferencesPlugin::initPlugin # spent 14µs making 1 call to Foswiki::Plugins::CompareRevisionsAddonPlugin::initPlugin
229 $Foswiki::Plugins::SESSION->{topicName},
230 $Foswiki::Plugins::SESSION->{webName},
231 $users->getLoginName( $Foswiki::Plugins::SESSION->{user} ),
232 $this->topicWeb()
233 );
2342532µs273µs
# spent 44µs (15+29) within Foswiki::Plugin::BEGIN@234 which was called: # once (15µs+29µs) by Foswiki::Plugins::BEGIN@21 at line 234
use strict 'refs';
# spent 44µs making 1 call to Foswiki::Plugin::BEGIN@234 # spent 29µs making 1 call to strict::import
235 }
236 catch Foswiki::AccessControlException with {
237 shift->throw(); # propagate
238 }
239 catch Foswiki::OopsException with {
240 shift->throw(); # propagate
241 }
242 catch Foswiki::ValidationException with {
243 shift->throw(); # propagate
244 }
245 otherwise {
246 my $e = shift;
247 $exception = $e->text() . ' ' . $e->stacktrace();
2481521.40ms };
# spent 757µs making 57 calls to Error::catch, avg 13µs/call # spent 390µs making 19 calls to Error::subs::otherwise, avg 21µs/call # spent 252µs making 57 calls to Error::subs::with, avg 4µs/call # spent 81.2s making 19 calls to Error::subs::try, avg 4.27s/call, recursion: max depth 1, sum of overlapping time 81.2s
249
250 unless ($status) {
251 if ( !$exception ) {
252 $exception = <<MESSAGE;
253$sub did not return true.
254Check your Foswiki warning and error logs for more information.
255MESSAGE
256 }
257 push( @{ $this->{errors} }, $exception );
258 $this->{disabled} = 1;
259 return;
260 }
261
262 my $compat = eval '\%' . $p . '::FoswikiCompatibility';
# spent 11µs executing statements in 2 string evals (merged) # spent 10µs executing statements in string eval # spent 10µs executing statements in string eval # spent 7µs executing statements in string eval # spent 6µs executing statements in string eval # spent 6µs executing statements in string eval # spent 6µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval # spent 5µs executing statements in string eval
263 foreach my $h (@registrableHandlers) {
26411783.21ms my $sub = $p . '::' . $h;
26585357µs if ( defined(&$sub) ) {
26612µs if ( $deprecated{$h}
267 && $compat
268 && $compat->{$h}
269 && $compat->{$h} <= $Foswiki::Plugins::VERSION )
270 {
271
272 # Compatibility handler not required in this version
273 next;
274 }
27542540µs $plugins->addListener( $h, $this );
# spent 540µs making 42 calls to Foswiki::Plugins::addListener, avg 13µs/call
276 }
277 }
27819249µs $this->{session}->enterContext( $this->{name} . 'Enabled' );
# spent 249µs making 19 calls to Foswiki::enterContext, avg 13µs/call
279}
280
281# Invoke a handler
282
# spent 367ms (137+230) within Foswiki::Plugin::invoke which was called 10316 times, avg 36µs/call: # 10316 times (137ms+230ms) by Foswiki::Plugins::dispatch at line 331 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 36µs/call
sub invoke {
28341264158ms my $this = shift; # remove from parameter vector
284 my $handlerName = shift;
285 my $handler = $this->{module} . '::' . $handlerName;
286268µs278µs
# spent 48µs (17+30) within Foswiki::Plugin::BEGIN@286 which was called: # once (17µs+30µs) by Foswiki::Plugins::BEGIN@21 at line 286
no strict 'refs';
# spent 48µs making 1 call to Foswiki::Plugin::BEGIN@286 # spent 30µs making 1 call to strict::unimport
28710316230ms return &$handler(@_);
# spent 49.3ms making 5 calls to Foswiki::Plugins::TablePlugin::preRenderingHandler, avg 9.86ms/call # spent 32.8ms making 1131 calls to Foswiki::Plugins::TablePlugin::afterCommonTagsHandler, avg 29µs/call # spent 30.1ms making 1131 calls to Foswiki::Plugins::WysiwygPlugin::beforeCommonTagsHandler, avg 27µs/call # spent 19.4ms making 1151 calls to Foswiki::Plugins::SpreadSheetPlugin::commonTagsHandler, avg 17µs/call # spent 17.0ms making 1131 calls to Foswiki::Plugins::PreferencesPlugin::beforeCommonTagsHandler, avg 15µs/call # spent 16.7ms making 1151 calls to Foswiki::Plugins::CompareRevisionsAddonPlugin::commonTagsHandler, avg 14µs/call # spent 15.3ms making 1131 calls to Foswiki::Plugins::EditTablePlugin::beforeCommonTagsHandler, avg 14µs/call # spent 14.1ms making 1151 calls to Foswiki::Plugins::SmiliesPlugin::commonTagsHandler, avg 12µs/call # spent 14.1ms making 1151 calls to Foswiki::Plugins::SlideShowPlugin::commonTagsHandler, avg 12µs/call # spent 13.9ms making 1151 calls to Foswiki::Plugins::EditTablePlugin::commonTagsHandler, avg 12µs/call # spent 5.79ms making 5 calls to Foswiki::Plugins::SmiliesPlugin::preRenderingHandler, avg 1.16ms/call # spent 1.02ms making 5 calls to Foswiki::Plugins::InterwikiPlugin::preRenderingHandler, avg 203µs/call # spent 235µs making 1 call to Foswiki::Plugins::JQueryPlugin::modifyHeaderHandler # spent 160µs making 5 calls to Foswiki::Plugins::EditTablePlugin::postRenderingHandler, avg 32µs/call # spent 159µs making 5 calls to Foswiki::Plugins::RenderListPlugin::startRenderingHandler, avg 32µs/call # spent 141µs making 5 calls to Foswiki::Plugins::PreferencesPlugin::postRenderingHandler, avg 28µs/call # spent 94µs making 1 call to Foswiki::Plugins::WysiwygPlugin::modifyHeaderHandler # spent 40µs making 5 calls to Foswiki::Plugins::WysiwygPlugin::postRenderingHandler, avg 8µs/call
288276µs272µs
# spent 44µs (16+28) within Foswiki::Plugin::BEGIN@288 which was called: # once (16µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 288
use strict 'refs';
# spent 44µs making 1 call to Foswiki::Plugin::BEGIN@288 # spent 28µs making 1 call to strict::import
289}
290
291# Get the VERSION number of the specified plugin.
292# SMELL: may die if the plugin doesn't compile
293sub getVersion {
294 my $this = shift;
295
296265µs271µs
# spent 43µs (16+28) within Foswiki::Plugin::BEGIN@296 which was called: # once (16µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 296
no strict 'refs';
# spent 43µs making 1 call to Foswiki::Plugin::BEGIN@296 # spent 28µs making 1 call to strict::unimport
297 return ${ $this->{module} . '::VERSION' } || '';
298288µs271µs
# spent 43µs (15+28) within Foswiki::Plugin::BEGIN@298 which was called: # once (15µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 298
use strict 'refs';
# spent 43µs making 1 call to Foswiki::Plugin::BEGIN@298 # spent 28µs making 1 call to strict::import
299}
300
301# Get the RELEASE of the specified plugin.
302# SMELL: may die if the plugin doesn't compile
303sub getRelease {
304 my $this = shift;
305
306268µs277µs
# spent 49µs (20+28) within Foswiki::Plugin::BEGIN@306 which was called: # once (20µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 306
no strict 'refs';
# spent 49µs making 1 call to Foswiki::Plugin::BEGIN@306 # spent 28µs making 1 call to strict::unimport
307 return ${ $this->{module} . '::RELEASE' } || '';
3082493µs271µs
# spent 43µs (15+28) within Foswiki::Plugin::BEGIN@308 which was called: # once (15µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 308
use strict 'refs';
# spent 43µs making 1 call to Foswiki::Plugin::BEGIN@308 # spent 28µs making 1 call to strict::import
309}
310
311# Get the description string for the given plugin
312sub getDescription {
313 my $this = shift;
314
315 unless ( defined $this->{description} ) {
316 my $pref = uc( $this->{name} ) . '_SHORTDESCRIPTION';
317 my $prefs = $this->{session}->{prefs};
318 $this->{description} = $prefs->getPreference($pref) || '';
319 }
320 if ( $this->{disabled} ) {
321 return ' !' . $this->{name} . ': (disabled)';
322 }
323
324 my $release = $this->getRelease();
325 my $version = $this->getVersion();
326 $version =~ s/\$Rev: (\d+) \$/$1/g;
327 $version = $release . ', ' . $version if $release;
328
329 my $web = $this->topicWeb();
330 my $result = ' ' . ( $web ? "$web." : '!' ) . $this->{name} . ' ';
331 $result .= CGI::span( { class => 'foswikiGrayText foswikiSmall' },
332 '(' . $version . ')' );
333 $result .= ': ' . $this->{description};
334 return $result;
335}
336
337=begin TML
338
339---++ ObjectMethod topicWeb() -> $webname
340
341Find the web that has the topic for this plugin by searching the
342{Plugins}{WebSearchPath}. Returns undef if $NO_PREFS_IN_TOPIC=1
343
344=cut
345
346
# spent 181µs within Foswiki::Plugin::topicWeb which was called 19 times, avg 10µs/call: # 19 times (181µs+0s) by Foswiki::Plugin::__ANON__[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugin.pm:235] at line 228, avg 10µs/call
sub topicWeb {
34757220µs my $this = shift;
348
349 unless ( defined( $this->{topicWeb} ) || $this->{no_topic} ) {
350
351 # Find the plugin topic, if required
352 my $session = $this->{session};
353
354 foreach
355 my $web ( split( /[, ]+/, $Foswiki::cfg{Plugins}{WebSearchPath} ),
356 $session->{webName} )
357 {
358 if ( $session->topicExists( $web, $this->{name} ) ) {
359 $this->{topicWeb} = $web;
360 last;
361 }
362 }
363 }
364
365 # If there is no web (probably because NO_PREFS_IN_TOPIC is set)
366 # then default to the system web name.
367 return $this->{topicWeb} || $Foswiki::cfg{SystemWebName};
368}
369
370112µs1;
371__END__