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

Filename/var/www/foswikidev/core/lib/Foswiki/If/OP_istopic.pm
StatementsExecuted 55 statements in 337µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41189µs433µsFoswiki::If::OP_istopic::::evaluateFoswiki::If::OP_istopic::evaluate
11116µs29µsFoswiki::If::OP_istopic::::newFoswiki::If::OP_istopic::new
11112µs25µsFoswiki::If::OP_istopic::::BEGIN@11Foswiki::If::OP_istopic::BEGIN@11
1118µs12µsFoswiki::If::OP_istopic::::BEGIN@12Foswiki::If::OP_istopic::BEGIN@12
1113µs3µsFoswiki::If::OP_istopic::::BEGIN@17Foswiki::If::OP_istopic::BEGIN@17
1113µs3µsFoswiki::If::OP_istopic::::BEGIN@14Foswiki::If::OP_istopic::BEGIN@14
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=begin TML
4
5---+ package Foswiki::If::OP_istopic
6
7=cut
8
9package Foswiki::If::OP_istopic;
10
11224µs237µs
# spent 25µs (12+12) within Foswiki::If::OP_istopic::BEGIN@11 which was called: # once (12µs+12µs) by Foswiki::If::Parser::BEGIN@28 at line 11
use strict;
# spent 25µs making 1 call to Foswiki::If::OP_istopic::BEGIN@11 # spent 12µs making 1 call to strict::import
12222µs216µs
# spent 12µs (8+4) within Foswiki::If::OP_istopic::BEGIN@12 which was called: # once (8µs+4µs) by Foswiki::If::Parser::BEGIN@28 at line 12
use warnings;
# spent 12µs making 1 call to Foswiki::If::OP_istopic::BEGIN@12 # spent 4µs making 1 call to warnings::import
13
14252µs13µs
# spent 3µs within Foswiki::If::OP_istopic::BEGIN@14 which was called: # once (3µs+0s) by Foswiki::If::Parser::BEGIN@28 at line 14
use Foswiki::Query::UnaryOP ();
# spent 3µs making 1 call to Foswiki::If::OP_istopic::BEGIN@14
1517µsour @ISA = ('Foswiki::Query::UnaryOP');
16
17
# spent 3µs within Foswiki::If::OP_istopic::BEGIN@17 which was called: # once (3µs+0s) by Foswiki::If::Parser::BEGIN@28 at line 22
BEGIN {
1815µs if ( $Foswiki::cfg{UseLocale} ) {
19 require locale;
20 import locale();
21 }
221143µs13µs}
# spent 3µs making 1 call to Foswiki::If::OP_istopic::BEGIN@17
23
24
# spent 29µs (16+13) within Foswiki::If::OP_istopic::new which was called: # once (16µs+13µs) by Foswiki::If::Parser::new at line 49 of /var/www/foswikidev/core/lib/Foswiki/If/Parser.pm
sub new {
251300ns my $class = shift;
26115µs113µs return $class->SUPER::new( name => 'istopic', prec => 600 );
# spent 13µs making 1 call to Foswiki::Query::UnaryOP::new
27}
28
29
# spent 433µs (89+344) within Foswiki::If::OP_istopic::evaluate which was called 4 times, avg 108µs/call: # 4 times (89µs+344µs) by Foswiki::Query::Node::evaluate at line 223 of /var/www/foswikidev/core/lib/Foswiki/Query/Node.pm, avg 108µs/call
sub evaluate {
3042µs my $this = shift;
314700ns my $node = shift;
3242µs my $a = $node->{params}->[0];
3344µs my %domain = @_;
3446µs45µs my $session = $domain{tom}->session;
# spent 5µs making 4 calls to Foswiki::Meta::session, avg 1µs/call
3541µs throw Error::Simple(
36 'No context in which to evaluate "' . $a->stringify() . '"' )
37 unless $session;
38411µs49µs my ( $web, $topic ) = ( $session->{webName}, $a->_evaluate(@_) );
# spent 9µs making 4 calls to Foswiki::If::Node::_evaluate, avg 2µs/call
39
4044µs return 0
41 unless ( defined $topic && length($topic) )
42 ; # null/empty topic cannot possibly exist
4342µs return 0
44 if ( $topic eq '0' ); # special case, topic name '0' normalizes to WebHome
45
46411µs432µs ( $web, $topic ) = $session->normalizeWebTopicName( $web, $topic );
# spent 32µs making 4 calls to Foswiki::normalizeWebTopicName, avg 8µs/call
47
48422µs4298µs return $session->topicExists( $web, $topic ) ? 1 : 0;
# spent 298µs making 4 calls to Foswiki::topicExists, avg 74µs/call
49}
50
5113µs1;
52__END__