Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Performance of possessive quantifiers

by demerphq (Chancellor)
on Jan 28, 2008 at 14:09 UTC ( [id://664686]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://664686]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-24 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found