← 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/Plugins/CommentPlugin.pm
StatementsExecuted 81 statements in 707µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
13112.41ms2.78msFoswiki::Plugins::CommentPlugin::::commonTagsHandlerFoswiki::Plugins::CommentPlugin::commonTagsHandler
11114µs27µsFoswiki::Plugins::CommentPlugin::::BEGIN@7Foswiki::Plugins::CommentPlugin::BEGIN@7
11110µs16µsFoswiki::Plugins::CommentPlugin::::BEGIN@8Foswiki::Plugins::CommentPlugin::BEGIN@8
1119µs28µsFoswiki::Plugins::CommentPlugin::::BEGIN@13Foswiki::Plugins::CommentPlugin::BEGIN@13
1118µs8µsFoswiki::Plugins::CommentPlugin::::initPluginFoswiki::Plugins::CommentPlugin::initPlugin
1115µs5µsFoswiki::Plugins::CommentPlugin::::BEGIN@10Foswiki::Plugins::CommentPlugin::BEGIN@10
1114µs4µsFoswiki::Plugins::CommentPlugin::::BEGIN@11Foswiki::Plugins::CommentPlugin::BEGIN@11
0000s0sFoswiki::Plugins::CommentPlugin::::beforeSaveHandlerFoswiki::Plugins::CommentPlugin::beforeSaveHandler
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# See Plugin topic for history and plugin information
4
5package Foswiki::Plugins::CommentPlugin;
6
7231µs240µs
# spent 27µs (14+13) within Foswiki::Plugins::CommentPlugin::BEGIN@7 which was called: # once (14µs+13µs) by Foswiki::Plugin::BEGIN@2.2 at line 7
use strict;
# spent 27µs making 1 call to Foswiki::Plugins::CommentPlugin::BEGIN@7 # spent 13µs making 1 call to strict::import
8226µs222µs
# spent 16µs (10+6) within Foswiki::Plugins::CommentPlugin::BEGIN@8 which was called: # once (10µs+6µs) by Foswiki::Plugin::BEGIN@2.2 at line 8
use warnings;
# spent 16µs making 1 call to Foswiki::Plugins::CommentPlugin::BEGIN@8 # spent 6µs making 1 call to warnings::import
9
10219µs15µs
# spent 5µs within Foswiki::Plugins::CommentPlugin::BEGIN@10 which was called: # once (5µs+0s) by Foswiki::Plugin::BEGIN@2.2 at line 10
use Foswiki::Func ();
# spent 5µs making 1 call to Foswiki::Plugins::CommentPlugin::BEGIN@10
11224µs14µs
# spent 4µs within Foswiki::Plugins::CommentPlugin::BEGIN@11 which was called: # once (4µs+0s) by Foswiki::Plugin::BEGIN@2.2 at line 11
use Foswiki::Plugins ();
# spent 4µs making 1 call to Foswiki::Plugins::CommentPlugin::BEGIN@11
12
133302µs354µs
# spent 28µs (9+19) within Foswiki::Plugins::CommentPlugin::BEGIN@13 which was called: # once (9µs+19µs) by Foswiki::Plugin::BEGIN@2.2 at line 13
use version; our $VERSION = version->declare("v1.1.6");
# spent 28µs making 1 call to Foswiki::Plugins::CommentPlugin::BEGIN@13 # spent 19µs making 1 call to version::import # spent 7µs making 1 call to version::vxs::declare
141300nsour $RELEASE = '1.1.6';
151500nsour $SHORTDESCRIPTION =
16 'Quickly post comments to a page without an edit/save cycle';
171200nsour $NO_PREFS_IN_TOPIC = 1;
18
19
# spent 8µs within Foswiki::Plugins::CommentPlugin::initPlugin which was called: # once (8µs+0s) by Foswiki::Plugin::__ANON__[/var/www/foswiki11/lib/Foswiki/Plugin.pm:241] at line 234 of /var/www/foswiki11/lib/Foswiki/Plugin.pm
sub initPlugin {
20
21 #my ( $topic, $web, $user, $installWeb ) = @_;
2218µs return 1;
23}
24
25
# spent 2.78ms (2.41+372µs) within Foswiki::Plugins::CommentPlugin::commonTagsHandler which was called 13 times, avg 214µs/call: # 13 times (2.41ms+372µs) by Foswiki::Plugin::invoke at line 294 of /var/www/foswiki11/lib/Foswiki/Plugin.pm, avg 214µs/call
sub commonTagsHandler {
261342µs my ( $text, $topic, $web, $meta ) = @_;
27
281397µs require Foswiki::Plugins::CommentPlugin::Comment;
29
301341µs13189µs my $query = Foswiki::Func::getCgiQuery();
# spent 189µs making 13 calls to Foswiki::Func::getCgiQuery, avg 15µs/call
31135µs return unless ( defined($query) );
32
3313109µs return unless $_[0] =~ m/%COMMENT({.*?})?%/o;
34
35 # SMELL: Nasty, tacky way to find out where we were invoked from
36 my $scriptname = $ENV{'SCRIPT_NAME'} || '';
37
38 # SMELL: unreliable
39 my $previewing = ( $scriptname =~ /\/(preview|gnusave|rdiff|compare)/ );
40 Foswiki::Plugins::CommentPlugin::Comment::prompt( $previewing, $_[0], $web,
41 $topic );
42}
43
44sub beforeSaveHandler {
45
46 #my ( $text, $topic, $web ) = @_;
47
48 require Foswiki::Plugins::CommentPlugin::Comment;
49
50 my $query = Foswiki::Func::getCgiQuery();
51 return unless $query;
52
53 my $action = $query->param('comment_action');
54
55 return unless ( defined($action) && $action eq 'save' );
56
57 # Stop it being applied again
58 $query->delete('comment_action');
59
60 Foswiki::Plugins::CommentPlugin::Comment::save(@_);
61}
62
6314µs1;
64__END__