http://qs321.pair.com?node_id=664686


in reply to Re: Performance of possessive quantifiers
in thread Performance of possessive quantifiers

try

m/(?>$re)+(*SKIP)\d/

on 5.11

And it looks like something broke the superlinear cache. Even with atomic matching this pattern/string combination goes quadratic, as nothing anchors the start of the pattern. Without the atomic matching its worse. Im not sure what the deal is with $re++ either. I would have expected that to have similar performance to (?>$re)+, its possible thats actually a bug. Ill have to think about it.

Oh, and dont use benchmarks from a debugging perl. Depending on the code path you go through variable amounts of debugging goo, so using a debugging perl, especially a 5.9.x or later version will not give useful results even comparing features.

---
$world=~s/war/peace/g

Replies are listed 'Best First'.
Re^3: Performance of possessive quantifiers
by tsee (Curate) on Jan 28, 2008 at 16:14 UTC

    Ah, thanks for that last remark, I'll keep it in mind for future testing.

    However, I double-checked and while I thought I remembered that -Dusedevel implied -DDEBUGGING, it doesn't seem so*. Hence, the 5.11 I used for the above results was no debugging build. Sorry for the confusion!

    Cheers,
    Steffen

    * I did "./Configure -Dusedevel -de 2>&1 | grep -i debug" and "make -j3 | grep -i debug" without any mention of DEBUGGING.

      The -Dusedevel option to Configure just quiets the "WHOA THERE, is this a development version of perl" message that otherwise quits Configure.

      I verified my original benchmarks with non-debugging perls (I wasn't sure if my 5.10 had been debugging, and I missed to look at perl5.10.0 -V ;), it didn't change anything.