Filename | /var/www/foswiki11/lib/Foswiki/Query/UnaryOP.pm |
Statements | Executed 60 statements in 727µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
24 | 12 | 12 | 255µs | 472µs | new | Foswiki::Query::UnaryOP::
1 | 1 | 1 | 21µs | 40µs | BEGIN@4 | Foswiki::Query::UnaryOP::
1 | 1 | 1 | 16µs | 31µs | BEGIN@33 | Foswiki::Query::UnaryOP::
1 | 1 | 1 | 12µs | 29µs | BEGIN@35 | Foswiki::Query::UnaryOP::
1 | 1 | 1 | 12µs | 19µs | BEGIN@5 | Foswiki::Query::UnaryOP::
1 | 1 | 1 | 8µs | 8µs | BEGIN@6 | Foswiki::Query::UnaryOP::
0 | 0 | 0 | 0s | 0s | evalUnary | Foswiki::Query::UnaryOP::
0 | 0 | 0 | 0s | 0s | evaluatesToConstant | Foswiki::Query::UnaryOP::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | package Foswiki::Query::UnaryOP; | ||||
3 | |||||
4 | 2 | 38µs | 2 | 58µs | # spent 40µs (21+18) within Foswiki::Query::UnaryOP::BEGIN@4 which was called:
# once (21µs+18µs) by Foswiki::Query::OP_lc::BEGIN@14 at line 4 # spent 40µs making 1 call to Foswiki::Query::UnaryOP::BEGIN@4
# spent 18µs making 1 call to strict::import |
5 | 2 | 40µs | 2 | 27µs | # spent 19µs (12+7) within Foswiki::Query::UnaryOP::BEGIN@5 which was called:
# once (12µs+7µs) by Foswiki::Query::OP_lc::BEGIN@14 at line 5 # spent 19µs making 1 call to Foswiki::Query::UnaryOP::BEGIN@5
# spent 7µs making 1 call to warnings::import |
6 | 2 | 263µs | 1 | 8µs | # spent 8µs within Foswiki::Query::UnaryOP::BEGIN@6 which was called:
# once (8µs+0s) by Foswiki::Query::OP_lc::BEGIN@14 at line 6 # spent 8µs making 1 call to Foswiki::Query::UnaryOP::BEGIN@6 |
7 | 1 | 9µs | our @ISA = ('Foswiki::Query::OP'); | ||
8 | |||||
9 | # spent 472µs (255+217) within Foswiki::Query::UnaryOP::new which was called 24 times, avg 20µs/call:
# 3 times (48µs+25µs) by Foswiki::Query::OP_lc::new at line 20 of /var/www/foswiki11/lib/Foswiki/Query/OP_lc.pm, avg 24µs/call
# 3 times (28µs+24µs) by Foswiki::Query::OP_ob::new at line 19 of /var/www/foswiki11/lib/Foswiki/Query/OP_ob.pm, avg 17µs/call
# 3 times (28µs+22µs) by Foswiki::Query::OP_not::new at line 19 of /var/www/foswiki11/lib/Foswiki/Query/OP_not.pm, avg 17µs/call
# 3 times (28µs+22µs) by Foswiki::Query::OP_d2n::new at line 19 of /var/www/foswiki11/lib/Foswiki/Query/OP_d2n.pm, avg 16µs/call
# 3 times (28µs+21µs) by Foswiki::Query::OP_length::new at line 19 of /var/www/foswiki11/lib/Foswiki/Query/OP_length.pm, avg 16µs/call
# 3 times (27µs+22µs) by Foswiki::Query::OP_uc::new at line 20 of /var/www/foswiki11/lib/Foswiki/Query/OP_uc.pm, avg 16µs/call
# once (11µs+16µs) by Foswiki::If::OP_context::new at line 19 of /var/www/foswiki11/lib/Foswiki/If/OP_context.pm
# once (12µs+13µs) by Foswiki::If::OP_dollar::new at line 19 of /var/www/foswiki11/lib/Foswiki/If/OP_dollar.pm
# once (12µs+13µs) by Foswiki::If::OP_istopic::new at line 19 of /var/www/foswiki11/lib/Foswiki/If/OP_istopic.pm
# once (11µs+13µs) by Foswiki::If::OP_defined::new at line 19 of /var/www/foswiki11/lib/Foswiki/If/OP_defined.pm
# once (11µs+13µs) by Foswiki::If::OP_isempty::new at line 19 of /var/www/foswiki11/lib/Foswiki/If/OP_isempty.pm
# once (11µs+13µs) by Foswiki::If::OP_isweb::new at line 19 of /var/www/foswiki11/lib/Foswiki/If/OP_isweb.pm | ||||
10 | 24 | 10µs | my $class = shift; | ||
11 | 24 | 251µs | 24 | 217µs | return $class->SUPER::new( arity => 1, @_ ); # spent 217µs making 24 calls to Foswiki::Query::OP::new, avg 9µs/call |
12 | } | ||||
13 | |||||
14 | sub evalUnary { | ||||
15 | my $this = shift; | ||||
16 | my $node = shift; | ||||
17 | my $sub = shift; | ||||
18 | my $a = $node->{params}[0]; | ||||
19 | my $val = $a->evaluate(@_); | ||||
20 | return undef unless defined $val; | ||||
21 | if ( ref($val) eq 'ARRAY' ) { | ||||
22 | my @res = map { &$sub($_) } @$val; | ||||
23 | return \@res; | ||||
24 | } | ||||
25 | else { | ||||
26 | return &$sub($val); | ||||
27 | } | ||||
28 | } | ||||
29 | |||||
30 | sub evaluatesToConstant { | ||||
31 | my $this = shift; | ||||
32 | my $node = shift; | ||||
33 | 2 | 58µs | 2 | 46µs | # spent 31µs (16+15) within Foswiki::Query::UnaryOP::BEGIN@33 which was called:
# once (16µs+15µs) by Foswiki::Query::OP_lc::BEGIN@14 at line 33 # spent 31µs making 1 call to Foswiki::Query::UnaryOP::BEGIN@33
# spent 15µs making 1 call to warnings::unimport |
34 | return $node->{params}[0]->evaluatesToConstant(@_); | ||||
35 | 2 | 55µs | 2 | 45µs | # spent 29µs (12+16) within Foswiki::Query::UnaryOP::BEGIN@35 which was called:
# once (12µs+16µs) by Foswiki::Query::OP_lc::BEGIN@14 at line 35 # spent 29µs making 1 call to Foswiki::Query::UnaryOP::BEGIN@35
# spent 16µs making 1 call to warnings::import |
36 | } | ||||
37 | |||||
38 | 1 | 4µs | 1; | ||
39 | __END__ |