Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^8: How does CATCH_SET optimize efficiency?

by dave_the_m (Prior)
on Dec 18, 2012 at 12:39 UTC ( #1009355=note: print w/replies, xml ) Need Help??

in reply to Re^7: How does CATCH_SET optimize efficiency?
in thread How does CATCH_SET optimize efficiency?

In something like
sub FETCH { eval { $x++ } $x--; eval { die } print; }
The first eval pushes a new setjmp and runops loop. The inc, dec and die ops are executed within that loop. The die causes a longjmp, which unwinds the C stack, destroying the inner runops loop, and returns control to the exception handler set up by the first call to entertry. That code 'restarts' the op by calling runops(), which executes the print and any remaining ops in FETCH. When FETCH returns, runops() exits, and control is passed back (again) to entertry's exception handler, which this time just immediately returns, passing control to the the middle runops loop, which also immediately returns, and control passes back to the code which handles tied variables.


Replies are listed 'Best First'.
Re^9: How does CATCH_SET optimize efficiency?
by PerlOnTheWay (Scribe) on Dec 19, 2012 at 08:18 UTC

    So the net effect is that when there's no eval in FETCH, a JMPENV_PUSH is saved, but when there is eval, a run loop is wasted(3 vs 2), is this right?



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009355]
[Corion]: Also, a good application to test my API to rate limit things
[choroba]: Dangers of WFH: a mailman rings, brings a parcel for my wife, I need to go outside, take my son with me, sign a paper *and* into the postman's mobile app, get back. Guess what the soup was doing meanwhiles?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2017-10-18 11:32 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (244 votes). Check out past polls.