Lisp Compilation

Compilation allows Lisp programs that have been debugged to run roughly 10 times faster than interpreted Lisp. There are several factors that account for the speedup:

  1. Many basic Lisp functions (e.g., car, cdr, null?, eq?) can be compiled directly as in-line machine code. This saves the overhead of function calls.

  2. Function calls can be speeded up by eliminating information that is saved on the stack during interpretation. (This may prevent use of debugging aids such as tracing.)

  3. Variable binding lookup can be eliminated by keeping local variables in special locations (e.g., registers).

  4. Tail-recursive functions can be converted to iterative functions by the compiler.

Contents    Page-10    Prev    Next    Index