Re: regex and performance question

2017-03-27 Thread ToddAndMargo

On 03/27/2017 10:43 AM, Brandon Allbery wrote:


On Mon, Mar 27, 2017 at 1:10 PM, ToddAndMargo > wrote:

Am I reintroducing a "regex"


It's a junction, not a regex. But junctions are even slower than
regexes: they are, in effect, trying to emulate a quantum computer. I
suspect it's doubly slow because not only are junctions themselves not
optimized, but it also breaks use of all other optimizations (figuring
out how to optimize them will be "fun").


Thank you!


Re: regex and performance question

2017-03-27 Thread Brandon Allbery
On Mon, Mar 27, 2017 at 1:10 PM, ToddAndMargo  wrote:

> Am I reintroducing a "regex"


It's a junction, not a regex. But junctions are even slower than regexes:
they are, in effect, trying to emulate a quantum computer. I suspect it's
doubly slow because not only are junctions themselves not optimized, but it
also breaks use of all other optimizations (figuring out how to optimize
them will be "fun").

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: regex and performance question

2017-03-27 Thread Timo Paulssen
Yeah, junctions are super useful, but not very fast.

compare these two pieces of code:

so "hello how are you today?".contains("hello" & "u t") for ^1_000_000

and

my $target = "hello how are you today?"; so
$target.contains("hello") && $target.contains("u t") for ^1_000_000


On my machine i get 25.7s for the first one and 1.5s for the second one.

On 27/03/17 19:10, ToddAndMargo wrote:
> Hi All,
>
> When I do a
>
>  if $x.contains( $y & "abc" )
>
> Am I reintroducing a "regex" and losing the performance
> gained by avoiding a regex?   Doesn't look like
> it to me, but I thought I'd better double check.
>
> Many thanks,
> -T
>