Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/OP_int.pm |
Statements | Executed 14 statements in 423µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 61µs | 141µs | new | Foswiki::Query::OP_int::
1 | 1 | 1 | 30µs | 38µs | BEGIN@11 | Foswiki::Query::OP_int::
1 | 1 | 1 | 16µs | 34µs | BEGIN@12 | Foswiki::Query::OP_int::
1 | 1 | 1 | 9µs | 9µs | BEGIN@14 | Foswiki::Query::OP_int::
0 | 0 | 0 | 0s | 0s | __ANON__[:35] | Foswiki::Query::OP_int::
0 | 0 | 0 | 0s | 0s | evaluate | Foswiki::Query::OP_int::
0 | 0 | 0 | 0s | 0s | evaluatesToConstant | Foswiki::Query::OP_int::
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::Query::OP_int | ||||
6 | |||||
7 | =cut | ||||
8 | |||||
9 | package Foswiki::Query::OP_int; | ||||
10 | |||||
11 | 2 | 45µs | 2 | 46µs | # spent 38µs (30+8) within Foswiki::Query::OP_int::BEGIN@11 which was called:
# once (30µs+8µs) by Foswiki::Query::Parser::BEGIN@61 at line 11 # spent 38µs making 1 call to Foswiki::Query::OP_int::BEGIN@11
# spent 8µs making 1 call to strict::import |
12 | 2 | 44µs | 2 | 52µs | # spent 34µs (16+18) within Foswiki::Query::OP_int::BEGIN@12 which was called:
# once (16µs+18µs) by Foswiki::Query::Parser::BEGIN@61 at line 12 # spent 34µs making 1 call to Foswiki::Query::OP_int::BEGIN@12
# spent 18µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 265µs | 1 | 9µs | # spent 9µs within Foswiki::Query::OP_int::BEGIN@14 which was called:
# once (9µs+0s) by Foswiki::Query::Parser::BEGIN@61 at line 14 # spent 9µs making 1 call to Foswiki::Query::OP_int::BEGIN@14 |
15 | 1 | 9µs | our @ISA = ('Foswiki::Query::UnaryOP'); | ||
16 | |||||
17 | # spent 141µs (61+80) within Foswiki::Query::OP_int::new which was called 3 times, avg 47µs/call:
# 3 times (61µs+80µs) by Foswiki::Query::Parser::new at line 105 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/Parser.pm, avg 47µs/call | ||||
18 | 3 | 7µs | my $class = shift; | ||
19 | 3 | 48µs | 3 | 80µs | return $class->SUPER::new( name => 'int', prec => 1000 ); # spent 80µs making 3 calls to Foswiki::Query::UnaryOP::new, avg 27µs/call |
20 | } | ||||
21 | |||||
22 | sub evaluate { | ||||
23 | my $this = shift; | ||||
24 | my $node = shift; | ||||
25 | |||||
26 | my $a = $node->{params}[0]->evaluate(@_); | ||||
27 | return $this->collect( | ||||
28 | $a, | ||||
29 | sub { | ||||
30 | defined $_[0] | ||||
31 | ? Foswiki::Query::OP::isNumber( $_[0] ) | ||||
32 | ? int( $_[0] ) | ||||
33 | : 0 | ||||
34 | : undef; | ||||
35 | } | ||||
36 | ); | ||||
37 | } | ||||
38 | |||||
39 | sub evaluatesToConstant { | ||||
40 | my $this = shift; | ||||
41 | my $node = shift; | ||||
42 | return $node->{params}[0]->evaluatesToConstant(@_); | ||||
43 | } | ||||
44 | |||||
45 | 1 | 6µs | 1; | ||
46 | __END__ |