Next: Self-Recursive Calls
Up: Advanced Compiler Use and
Previous: Tail Recursion Exceptions
  Contents
  Index
Local Call
local call
local
local
Python supports two kinds of function call: full call and local call.
Full call is the standard calling convention; its late binding and
generality make Common Lisp what it is, but create unavoidable overheads.
When the compiler can compile the calling function and the called
function simultaneously, it can use local call to avoid some of the
overhead of full call. Local call is really a collection of
compilation strategies. If some aspect of call overhead is not needed
in a particular local call, then it can be omitted. In some cases,
local call can be totally free. Local call provides two main
advantages to the user:
- Local call makes the use of the lexical function binding forms
flet and labels much more efficient. A local
call is always faster than a full call, and in many cases is much
faster.
- Local call is a natural approach to block compilation, a
compilation technique that resolves function references at compile
time. Block compilation speeds function call, but increases
compilation times and prevents function redefinition.
Subsections
Next: Self-Recursive Calls
Up: Advanced Compiler Use and
Previous: Tail Recursion Exceptions
  Contents
  Index
Peter Van Eynde
2000-02-08