On Sun, Feb 23, 2003 at 03:31:38AM +0000, Ton Hospel wrote: > - if the value isn't going to change (much), why did the user use a (??{$p}) ? > What is the scenario in which you expect the cache to be hit ? Please do something like dd if=/dev/zero of=/tmp/k count=4096 and run the script below on it with/without the optimization. ( Dropping the optimization is matter of commenting out the branch if (!(SvFLAGS(ret) ... at regexec.c:2892 - line number of the unpatched file ). I get: ratsnest# time perl /tmp/x /tmp/k # without the optimization real 0m54.794s user 0m54.752s sys 0m0.041s ratsnest# time perl /tmp/x /tmp/k # with the optimization in real 0m4.332s user 0m4.316s sys 0m0.016s Notice that instead of the silly quotes there the user may want to put some convoluted regular expressions, without putting it in qr// for some reason or another - these may be build up by some sub, etc. > - why is the r-magic not invalidated when the variable gets assigned ? That's just what my patch try to do: invalidate the r-magic when the variable gets assigned. ( I admit the test is silly - I suspect however that a more serious investigation will give the same results). Regards Adi /tmp/x -------------------------------------------- $entremets = " Tancowala ryba z rakiem, a pietruszka z pasternakiem. Cebula sie dziwowala, jak pietruszka tancowala. |#"; $appero = " Pisse une goutte dans ce vermouth, c'est pas beau mais c'est salaud. |%"; $entremets = "a"; $appero = "b"; $/=\4096; while(<>) { $a = not $a; print if /(??{ $a ? $entremets : $appero; })/ }Thread Previous | Thread Next