Filename | /var/www/foswikidev/core/lib/Foswiki/If/OP_context.pm |
Statements | Executed 107 statements in 375µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
12 | 1 | 1 | 143µs | 208µs | evaluate | Foswiki::If::OP_context::
1 | 1 | 1 | 31µs | 44µs | BEGIN@11 | Foswiki::If::OP_context::
1 | 1 | 1 | 18µs | 34µs | new | Foswiki::If::OP_context::
1 | 1 | 1 | 10µs | 14µs | BEGIN@12 | Foswiki::If::OP_context::
1 | 1 | 1 | 4µs | 4µs | BEGIN@17 | Foswiki::If::OP_context::
1 | 1 | 1 | 4µs | 4µs | BEGIN@14 | Foswiki::If::OP_context::
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_context | ||||
6 | |||||
7 | =cut | ||||
8 | |||||
9 | package Foswiki::If::OP_context; | ||||
10 | |||||
11 | 2 | 32µs | 2 | 57µs | # spent 44µs (31+13) within Foswiki::If::OP_context::BEGIN@11 which was called:
# once (31µs+13µs) by Foswiki::If::Parser::BEGIN@23 at line 11 # spent 44µs making 1 call to Foswiki::If::OP_context::BEGIN@11
# spent 13µs making 1 call to strict::import |
12 | 2 | 24µs | 2 | 19µs | # spent 14µs (10+4) within Foswiki::If::OP_context::BEGIN@12 which was called:
# once (10µs+4µs) by Foswiki::If::Parser::BEGIN@23 at line 12 # spent 14µs making 1 call to Foswiki::If::OP_context::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 49µs | 1 | 4µs | # spent 4µs within Foswiki::If::OP_context::BEGIN@14 which was called:
# once (4µs+0s) by Foswiki::If::Parser::BEGIN@23 at line 14 # spent 4µs making 1 call to Foswiki::If::OP_context::BEGIN@14 |
15 | 1 | 7µs | our @ISA = ('Foswiki::Query::UnaryOP'); | ||
16 | |||||
17 | # spent 4µs within Foswiki::If::OP_context::BEGIN@17 which was called:
# once (4µs+0s) by Foswiki::If::Parser::BEGIN@23 at line 22 | ||||
18 | 1 | 4µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
19 | require locale; | ||||
20 | import locale(); | ||||
21 | } | ||||
22 | 1 | 134µs | 1 | 4µs | } # spent 4µs making 1 call to Foswiki::If::OP_context::BEGIN@17 |
23 | |||||
24 | # spent 34µs (18+16) within Foswiki::If::OP_context::new which was called:
# once (18µs+16µs) by Foswiki::If::Parser::new at line 49 of /var/www/foswikidev/core/lib/Foswiki/If/Parser.pm | ||||
25 | 1 | 400ns | my $class = shift; | ||
26 | 1 | 16µs | 1 | 16µs | return $class->SUPER::new( # spent 16µs making 1 call to Foswiki::Query::UnaryOP::new |
27 | name => 'context', | ||||
28 | prec => 600, | ||||
29 | casematters => 0 | ||||
30 | ); | ||||
31 | } | ||||
32 | |||||
33 | # spent 208µs (143+65) within Foswiki::If::OP_context::evaluate which was called 12 times, avg 17µs/call:
# 12 times (143µs+65µs) by Foswiki::Query::Node::evaluate at line 223 of /var/www/foswikidev/core/lib/Foswiki/Query/Node.pm, avg 17µs/call | ||||
34 | 12 | 3µs | my $this = shift; | ||
35 | 12 | 2µs | my $node = shift; | ||
36 | 12 | 6µs | my $a = $node->{params}->[0]; | ||
37 | 12 | 17µs | 12 | 21µs | my $text = $a->_evaluate(@_) || ''; # spent 21µs making 12 calls to Foswiki::If::Node::_evaluate, avg 2µs/call |
38 | 12 | 12µs | my %domain = @_; | ||
39 | 12 | 19µs | 12 | 17µs | my $session = $domain{tom}->session; # spent 17µs making 12 calls to Foswiki::Meta::session, avg 1µs/call |
40 | 12 | 2µs | throw Error::Simple( | ||
41 | 'No context in which to evaluate "' . $a->stringify() . '"' ) | ||||
42 | unless $session; | ||||
43 | 12 | 44µs | 12 | 28µs | return $session->inContext($text) || 0; # spent 28µs making 12 calls to Foswiki::inContext, avg 2µs/call |
44 | } | ||||
45 | |||||
46 | 1 | 3µs | 1; | ||
47 | __END__ |