Filename | /var/www/foswikidev/core/lib/Foswiki/If/OP_istopic.pm |
Statements | Executed 55 statements in 337µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4 | 1 | 1 | 89µs | 433µs | evaluate | Foswiki::If::OP_istopic::
1 | 1 | 1 | 16µs | 29µs | new | Foswiki::If::OP_istopic::
1 | 1 | 1 | 12µs | 25µs | BEGIN@11 | Foswiki::If::OP_istopic::
1 | 1 | 1 | 8µs | 12µs | BEGIN@12 | Foswiki::If::OP_istopic::
1 | 1 | 1 | 3µs | 3µs | BEGIN@17 | Foswiki::If::OP_istopic::
1 | 1 | 1 | 3µs | 3µs | BEGIN@14 | Foswiki::If::OP_istopic::
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 | |||||
9 | package Foswiki::If::OP_istopic; | ||||
10 | |||||
11 | 2 | 24µs | 2 | 37µ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 # spent 25µs making 1 call to Foswiki::If::OP_istopic::BEGIN@11
# spent 12µs making 1 call to strict::import |
12 | 2 | 22µs | 2 | 16µ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 # spent 12µs making 1 call to Foswiki::If::OP_istopic::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 52µs | 1 | 3µ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 # spent 3µs making 1 call to Foswiki::If::OP_istopic::BEGIN@14 |
15 | 1 | 7µs | our @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 | ||||
18 | 1 | 5µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
19 | require locale; | ||||
20 | import locale(); | ||||
21 | } | ||||
22 | 1 | 143µs | 1 | 3µ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 | ||||
25 | 1 | 300ns | my $class = shift; | ||
26 | 1 | 15µs | 1 | 13µ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 | ||||
30 | 4 | 2µs | my $this = shift; | ||
31 | 4 | 700ns | my $node = shift; | ||
32 | 4 | 2µs | my $a = $node->{params}->[0]; | ||
33 | 4 | 4µs | my %domain = @_; | ||
34 | 4 | 6µs | 4 | 5µs | my $session = $domain{tom}->session; # spent 5µs making 4 calls to Foswiki::Meta::session, avg 1µs/call |
35 | 4 | 1µs | throw Error::Simple( | ||
36 | 'No context in which to evaluate "' . $a->stringify() . '"' ) | ||||
37 | unless $session; | ||||
38 | 4 | 11µs | 4 | 9µs | my ( $web, $topic ) = ( $session->{webName}, $a->_evaluate(@_) ); # spent 9µs making 4 calls to Foswiki::If::Node::_evaluate, avg 2µs/call |
39 | |||||
40 | 4 | 4µs | return 0 | ||
41 | unless ( defined $topic && length($topic) ) | ||||
42 | ; # null/empty topic cannot possibly exist | ||||
43 | 4 | 2µs | return 0 | ||
44 | if ( $topic eq '0' ); # special case, topic name '0' normalizes to WebHome | ||||
45 | |||||
46 | 4 | 11µs | 4 | 32µs | ( $web, $topic ) = $session->normalizeWebTopicName( $web, $topic ); # spent 32µs making 4 calls to Foswiki::normalizeWebTopicName, avg 8µs/call |
47 | |||||
48 | 4 | 22µs | 4 | 298µs | return $session->topicExists( $web, $topic ) ? 1 : 0; # spent 298µs making 4 calls to Foswiki::topicExists, avg 74µs/call |
49 | } | ||||
50 | |||||
51 | 1 | 3µs | 1; | ||
52 | __END__ |