Filename | /var/www/foswiki11/lib/Foswiki/Query/OP_match.pm |
Statements | Executed 14 statements in 558µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 946µs | 1.47ms | BEGIN@14 | Foswiki::Query::OP_match::
3 | 1 | 1 | 58µs | 150µs | new | Foswiki::Query::OP_match::
1 | 1 | 1 | 24µs | 46µs | BEGIN@11 | Foswiki::Query::OP_match::
1 | 1 | 1 | 16µs | 25µs | BEGIN@12 | Foswiki::Query::OP_match::
0 | 0 | 0 | 0s | 0s | __ANON__[:38] | Foswiki::Query::OP_match::
0 | 0 | 0 | 0s | 0s | evaluate | Foswiki::Query::OP_match::
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_match | ||||
6 | |||||
7 | =cut | ||||
8 | |||||
9 | package Foswiki::Query::OP_match; | ||||
10 | |||||
11 | 2 | 51µs | 2 | 68µs | # spent 46µs (24+22) within Foswiki::Query::OP_match::BEGIN@11 which was called:
# once (24µs+22µs) by Foswiki::Query::Parser::new at line 11 # spent 46µs making 1 call to Foswiki::Query::OP_match::BEGIN@11
# spent 22µs making 1 call to strict::import |
12 | 2 | 40µs | 2 | 33µs | # spent 25µs (16+9) within Foswiki::Query::OP_match::BEGIN@12 which was called:
# once (16µs+9µs) by Foswiki::Query::Parser::new at line 12 # spent 25µs making 1 call to Foswiki::Query::OP_match::BEGIN@12
# spent 9µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 396µs | 1 | 1.47ms | # spent 1.47ms (946µs+526µs) within Foswiki::Query::OP_match::BEGIN@14 which was called:
# once (946µs+526µs) by Foswiki::Query::Parser::new at line 14 # spent 1.47ms making 1 call to Foswiki::Query::OP_match::BEGIN@14 |
15 | 1 | 11µs | our @ISA = ('Foswiki::Query::BinaryOP'); | ||
16 | |||||
17 | # spent 150µs (58+92) within Foswiki::Query::OP_match::new which was called 3 times, avg 50µs/call:
# 3 times (58µs+92µs) by Foswiki::Query::Parser::new at line 47 of /var/www/foswiki11/lib/Foswiki/Query/Parser.pm, avg 50µs/call | ||||
18 | 3 | 2µs | my $class = shift; | ||
19 | 3 | 52µs | 3 | 92µs | return $class->SUPER::new( name => '=~', prec => 500 ); # spent 92µs making 3 calls to Foswiki::Query::BinaryOP::new, avg 31µs/call |
20 | } | ||||
21 | |||||
22 | sub evaluate { | ||||
23 | my $this = shift; | ||||
24 | my $node = shift; | ||||
25 | |||||
26 | return $this->evalTest( | ||||
27 | $node, | ||||
28 | \@_, | ||||
29 | sub { | ||||
30 | my $regex; | ||||
31 | eval { $regex = qr/$_[1]/ }; | ||||
32 | if ($@) { | ||||
33 | throw Foswiki::Infix::Error( 'illegal regex', $_[1] ); | ||||
34 | } | ||||
35 | defined( $_[0] ) | ||||
36 | && defined( $_[1] ) | ||||
37 | && $_[0] =~ m/$regex/s ? 1 : 0; | ||||
38 | } | ||||
39 | ); | ||||
40 | } | ||||
41 | |||||
42 | 1 | 5µs | 1; | ||
43 | __END__ |