Filename | /var/www/foswiki11/lib/Foswiki/If/OP_defined.pm |
Statements | Executed 162 statements in 550µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
12 | 1 | 1 | 248µs | 923µs | evaluate | Foswiki::If::OP_defined::
1 | 1 | 1 | 26µs | 50µs | new | Foswiki::If::OP_defined::
1 | 1 | 1 | 19µs | 38µs | BEGIN@11 | Foswiki::If::OP_defined::
1 | 1 | 1 | 12µs | 19µs | BEGIN@12 | Foswiki::If::OP_defined::
1 | 1 | 1 | 5µs | 5µs | BEGIN@14 | Foswiki::If::OP_defined::
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_defined | ||||
6 | |||||
7 | =cut | ||||
8 | |||||
9 | package Foswiki::If::OP_defined; | ||||
10 | |||||
11 | 2 | 37µs | 2 | 56µs | # spent 38µs (19+18) within Foswiki::If::OP_defined::BEGIN@11 which was called:
# once (19µs+18µs) by Foswiki::If::Parser::new at line 11 # spent 38µs making 1 call to Foswiki::If::OP_defined::BEGIN@11
# spent 18µs making 1 call to strict::import |
12 | 2 | 37µs | 2 | 26µs | # spent 19µs (12+7) within Foswiki::If::OP_defined::BEGIN@12 which was called:
# once (12µs+7µs) by Foswiki::If::Parser::new at line 12 # spent 19µs making 1 call to Foswiki::If::OP_defined::BEGIN@12
# spent 7µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 245µs | 1 | 5µs | # spent 5µs within Foswiki::If::OP_defined::BEGIN@14 which was called:
# once (5µs+0s) by Foswiki::If::Parser::new at line 14 # spent 5µs making 1 call to Foswiki::If::OP_defined::BEGIN@14 |
15 | 1 | 9µs | our @ISA = ('Foswiki::Query::UnaryOP'); | ||
16 | |||||
17 | # spent 50µs (26+25) within Foswiki::If::OP_defined::new which was called:
# once (26µs+25µs) by Foswiki::If::Parser::new at line 31 of /var/www/foswiki11/lib/Foswiki/If/Parser.pm | ||||
18 | 1 | 800ns | my $class = shift; | ||
19 | 1 | 23µs | 1 | 24µs | return $class->SUPER::new( name => 'defined', prec => 600 ); # spent 24µs making 1 call to Foswiki::Query::UnaryOP::new |
20 | } | ||||
21 | |||||
22 | # spent 923µs (248+675) within Foswiki::If::OP_defined::evaluate which was called 12 times, avg 77µs/call:
# 12 times (248µs+675µs) by Foswiki::Query::Node::evaluate at line 184 of /var/www/foswiki11/lib/Foswiki/Query/Node.pm, avg 77µs/call | ||||
23 | 12 | 3µs | my $this = shift; | ||
24 | 12 | 2µs | my $node = shift; | ||
25 | 12 | 5µs | my $a = $node->{params}->[0]; | ||
26 | 12 | 18µs | my %domain = @_; | ||
27 | 12 | 23µs | 12 | 19µs | my $session = $domain{tom}->session; # spent 19µs making 12 calls to Foswiki::Meta::session, avg 2µs/call |
28 | 12 | 3µs | throw Error::Simple( | ||
29 | 'No context in which to evaluate "' . $a->stringify() . '"' ) | ||||
30 | unless $session; | ||||
31 | 12 | 22µs | 12 | 29µs | my $eval = $a->_evaluate(@_); # spent 29µs making 12 calls to Foswiki::If::Node::_evaluate, avg 2µs/call |
32 | 12 | 2µs | return 0 unless $eval; | ||
33 | 12 | 26µs | 12 | 244µs | return 1 if ( defined( $session->{request}->param($eval) ) ); # spent 244µs making 12 calls to Foswiki::Request::param, avg 20µs/call |
34 | 12 | 27µs | 12 | 94µs | return 1 if ( defined( $domain{tom}->getPreference($eval) ) ); # spent 94µs making 12 calls to Foswiki::Meta::getPreference, avg 8µs/call |
35 | 12 | 28µs | 12 | 289µs | return 1 if ( defined( $session->{prefs}->getPreference($eval) ) ); # spent 289µs making 12 calls to Foswiki::Prefs::getPreference, avg 24µs/call |
36 | 10 | 5µs | return 1 if ( exists( $Foswiki::macros{$eval} ) ); | ||
37 | 10 | 30µs | return 0; | ||
38 | } | ||||
39 | |||||
40 | 1 | 4µs | 1; | ||
41 | __END__ |