Next: , Previous: , Up: Advanced Compiler Use and Efficiency Hints   [Contents][Index]


5.9 Byte Coded Compilation

Python supports byte compilation to reduce the size of Lisp programs by allowing functions to be compiled more compactly. Byte compilation provides an extreme speed/space tradeoff: byte code is typically six times more compact than native code, but runs fifty times (or more) slower. This is about ten times faster than the standard interpreter, which is itself considered fast in comparison to other Common Lisp interpreters.

Large Lisp systems (such as CMUCL itself) often have large amounts of user-interface code, compile-time (macro) code, debugging code, or rarely executed special-case code. This code is a good target for byte compilation: very little time is spent running in it, but it can take up quite a bit of space. Straight-line code with many function calls is much more suitable than inner loops.

When byte-compiling, the compiler compiles about twice as fast, and can produce a hardware independent object file (.bytef type.) This file can be loaded like a normal fasl file on any implementation of CMUCL with the same byte-ordering.

The decision to byte compile or native compile can be done on a per-file or per-code-object basis. The :byte-compile argument to compile-file has these possible values:

nil

Don’t byte compile anything in this file.

t

Byte compile everything in this file and produce a processor-independent .bytef file.

:maybe

Produce a normal fasl file, but byte compile any functions for which the speed optimization quality is 0 and the debug quality is not greater than 1.

Variable: extensions:*byte-compile-top-level*

If this variable is true (the default) and the :byte-compile argument to compile-file is :maybe, then byte compile top-level code (code outside of any defun, defmethod, etc.)

Variable: extensions:*byte-compile-default*

This variable determines the default value for the :byte-compile argument to compile-file, initially :maybe.


Next: Object Representation, Previous: Inline Expansion, Up: Advanced Compiler Use and Efficiency Hints   [Contents][Index]