Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Inline subs?

by chromatic (Archbishop)
on May 02, 2003 at 19:19 UTC ( [id://255138]=note: print w/replies, xml ) Need Help??


in reply to Re: Inline subs?
in thread Inline subs?

Probably not. Subs can be slow because it's expensive to create, initialize, and enter a new lexical scope in Perl 5's internal stack-based system. Inlining is tricky because you still have to respect that lexical scoping -- and I doubt you'll get very much of a speed benefit because, in all but the simplest cases, you still have to pay the price of the ENTER/LEAVE ops.

You'll avoid the cost of sub dispatch and you might have better code coherency (though it'll depend on where the stash is located), but I'm not convinced you'll see dramatic benefits.

It'd probably be better to make ENTER/LEAVE faster than to treat the symptom.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-18 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found