Re: optimization idea

2004-12-11 Thread Jarkko Hietaniemi
Apologies for tooting my own horn, but I have released Regexp::Assemble, which does much the same thing, but has slightly different behaviour, it merges common tails as well: fish, flash - f(la|i)sh. The above-cited pattern becomes: fla(?:t(?:ulent)?|bby|sh) Toot toot. Regex::PreSuf

Re: optimization idea

2004-12-10 Thread David Landgren
Steve Peters wrote: On Wednesday 27 October 2004 03:17 pm, David Nicol wrote: trie optimization for regexp groups means optimizing things like m/(flash|flat|flatulent|flabby)\b/ into things like m/fla(sh|bby|(t(|ulent)))\b/ right? I wonder if it would be possible to do it with a regex

Re: optimization idea

2004-10-27 Thread David Nicol
trie optimization for regexp groups means optimizing things like m/(flash|flat|flatulent|flabby)\b/ into things like m/fla(sh|bby|(t(|ulent)))\b/ right? I wonder if it would be possible to do it with a regex preprocessor. On Tue, 26 Oct 2004 11:49:13 +0100, Nicholas Clark

Re: optimization idea

2004-10-27 Thread Steve Peters
On Wednesday 27 October 2004 03:17 pm, David Nicol wrote: trie optimization for regexp groups means optimizing things like m/(flash|flat|flatulent|flabby)\b/ into things like m/fla(sh|bby|(t(|ulent)))\b/ right? I wonder if it would be possible to do it with a regex

RE: optimization idea

2004-10-26 Thread Orton, Yves
Dave Mitchell wrote at 25 October 2004 22:38: On Mon, Oct 25, 2004 at 09:09:16PM +0200, Elizabeth Mattijsen wrote: Wouldn't you need to add taking a ref of the var, to invalidate this optimization? Specifically for this case: sub statename { my $name = 'david'; ${\$name}

RE: optimization idea

2004-10-26 Thread Elizabeth Mattijsen
At 10:30 AM +0100 10/26/04, Orton, Yves wrote: Dave Mitchell wrote at 25 October 2004 22:38: On Mon, Oct 25, 2004 at 09:09:16PM +0200, Elizabeth Mattijsen wrote: Wouldn't you need to add taking a ref of the var, to invalidate this optimization? Specifically for this case: sub statename

Re: optimization idea

2004-10-26 Thread H.Merijn Brand
On Tue 26 Oct 2004 12:24, Elizabeth Mattijsen [EMAIL PROTECTED] wrote: sub statename { my $name = 'david'; ${\$name} = 'liz'; return hello, my name is $name; } But surely in this case the ${\$name} should itself be optimised to $name first? Well, possibly. I

Re: optimization idea

2004-10-26 Thread Nicholas Clark
On Tue, Oct 26, 2004 at 12:32:07PM +0200, H.Merijn Brand wrote: On Tue 26 Oct 2004 12:24, Elizabeth Mattijsen [EMAIL PROTECTED] wrote: sub statename { my $name = 'david'; ${\$name} = 'liz'; return hello, my name is $name; } But surely in this case the

Re: optimization idea

2004-10-26 Thread David Nicol
On Tue, 26 Oct 2004 10:30:08 +0100, Orton, Yves [EMAIL PROTECTED] wrote: You cant detect the consequence of the eval but you can detect the eval no? So you could disable the optimisation if there is no eval between the constant assignment and the stringification yeah that's what I was

Re: optimization idea

2004-10-25 Thread Elizabeth Mattijsen
At 5:10 PM -0500 10/21/04, David Nicol wrote: when a lexical variable is not written to between getting assigned from a constant and getting interpolated, replace the value in the string at compile time example: sub statename{ my $name = 'david'; return hello my name is $name; } Wouldn't you

Re: optimization idea

2004-10-25 Thread Dave Mitchell
On Mon, Oct 25, 2004 at 09:09:16PM +0200, Elizabeth Mattijsen wrote: Wouldn't you need to add taking a ref of the var, to invalidate this optimization? Specifically for this case: sub statename { my $name = 'david'; ${\$name} = 'liz'; return hello, my name is $name; } Then

Re: optimization idea

2004-10-25 Thread David Nicol
okay. so lexicals that have not had references taken from them and have not existed while an eval is in place in their scope get marked as early replacable whenver they get a constant assigned, and the flag gets cleared when assigned to by something not a constant a reference is

Re: optimization idea

2004-10-25 Thread Dave Mitchell
On Mon, Oct 25, 2004 at 04:25:57PM -0500, David Nicol wrote: okay. so lexicals that have not had references taken from them and have not existed while an eval is in place in their scope get marked as early replacable whenver they get a constant assigned, and the flag gets cleared when

optimization idea

2004-10-21 Thread David Nicol
when a lexical variable is not written to between getting assigned from a constant and getting interpolated, replace the value in the string at compile time example: sub statename{ my $name = 'david'; return hello my name is $name; } -- David L Nicol transportation infrastructure