Searching for my question only yielded unrelated results. This comes the closest but it does not answer my question Are variables on the stack "statically allocated"? So I know that if a procedure makes no calls then its stack frame is allocated in the static memory section where global and static variables are stored. My question: why does this yield an advantage? Because at runtime if stack frames are allocated on the stack they are written as well just like static memory right? Thanks!
While the premise of this question is really questionable (1), there is an answer.
It takes a few instructions to push and pop a stack frame. So, if it were really true that you could stick the locals in static, you save those instructions.
In my purely personal opinion, the value of this would be tiny except in some truly special circumstance in which the stack management costs were truly a significant fraction of the entire procedure -- which is very hard to believe.
(1) In any multithreaded environment, any procedure can be active multiply whether or not it calls something.