Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Perl 5 Optimizing Compiler

by rurban (Scribe)
on Oct 18, 2012 at 15:18 UTC ( [id://999755]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl 5 Optimizing Compiler
in thread Perl 5 Optimizing Compiler

Because a stack access is 1. ~70 times faster then a heap access, 2. allocation is for free, 3. you do not need to clean up the stack, and 4. stack ptrs are thread safe. That's why normal programming languages use an ABI which puts parameters onto the stack and better align it properly to be able to use MMX. It's not only for recursion.

Compare reading or writing at %ebp+8 against any absolute ptr. It's about 5 against 150 micro instructions.

Stack accesses are also relative and hot and local, heap accesses usually not. Some heap ptrs are hot and cached, but you still have the cache overhead.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2026-04-20 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.