Why is not inlining that bad?

Janice Caron caron800 at googlemail.com
Mon Oct 8 00:02:41 PDT 2007


Forgive me if this is a dumb question, but in other threads I've seen
it argued that dereferencing an address from a register offset is not
something that anyone needs to be worried about, and that array
accesses are so fast that no one need worry about them, etc.

This being the case, why is anyone worried about the overhead of a
function call? It's just a memory write and a few registers changing,
surely? It's not a massively expensive operation like a thread switch
or anything, so why worry?

If the hardware does memory caching, the return may not even need a
memory access.

What am I missing? Is it just that D initializes all its local
variables as part of calling a function? If so, there are plenty of
ways around that.



More information about the Digitalmars-d mailing list