Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: What perl operations will consume C stack space?

by BrowserUk (Patriarch)
on Feb 24, 2006 at 23:45 UTC ( [id://532705]=note: print w/replies, xml ) Need Help??


in reply to Re: What perl operations will consume C stack space?
in thread What perl operations will consume C stack space?

Any good (as in pathologically stack consuming) examples? I've created many that consume time, but not stack.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: What perl operations will consume C stack space?
by spurperl (Priest) on Feb 25, 2006 at 06:08 UTC
    Aren't Perl regexes compiled into NFAs, and matching NFAs requires backtracking ? So I guess backtracking-heavy regexes like [a-e][r-z][4-9][^xyz] should eat up lots of stack.

      Hmm. I guess I didn't realise I was asking for trade secrets here.

      Your example is incomplete as you don't say what string you would need to run it against for it to produce pathological behaviour.

      As I've mentioned, I've produced many that take a long time to process, but I'm failing to grasp the significance of what aspects take time, and which consume stack. Maybe this should be obvious to me, but it isn't.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-23 21:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found