optimize declaration recognizes six different
qualities. The qualities are conceptually independent aspects
of program performance. In reality, increasing one quality tends to
have adverse effects on other qualities. The compiler compares the
relative values of qualities when it needs to make a trade-off; i.e.,
speed is greater than
safety, then improve speed at
the cost of safety.
The default for all qualities (except
Whenever qualities are equal, ties are broken according to a broad
idea of what a good default environment is supposed to be. Generally
debug. Novice and casual users
should stick to the default policy. Advanced users often want to
improve speed and memory usage at the cost of safety and
If the value for a quality is
3, then it may have a
special interpretation. A value of
0 means “totally
unimportant”, and a
3 means “ultimately important.” These
extreme optimization values enable “heroic” compilation strategies
that are not always desirable and sometimes self-defeating.
Specifying more than one quality as
3 is not desirable, since
it doesn’t tell the compiler which quality is most important.
These are the optimization qualities:
How fast the
program should is run.
speed 3 enables some optimizations
that hurt debuggability.
How fast the compiler should run. Note that increasing
safety weakens type checking.
How much space
the compiled code should take up. Inline expansion is mostly
space is greater than
speed. A value
0 enables promiscuous inline expansion. Wide use of a
0 value is not recommended, as it may waste so much space
that run time is slowed. See inline-expansion for a discussion
of inline expansion.
How debuggable the program should be. The quality is treated differently from the other qualities: each value indicates a particular level of debugger information; it is not compared with the other qualities. See debugger-policy for more details.
error checking should be done. If
compilation-speed is more important than
type checking is weakened (see weakened-type-checks). If
0, then no run time error checking is done.
In addition to suppressing type checks,
0 also suppresses
argument count checking, unbound-symbol checking and array bounds
This is a CMUCL extension that determines how
little (or how much) diagnostic output should be printed during
compilation. This quality is compared to other qualities to
determine whether to print style notes and warnings concerning those
speed is greater than
then notes about how to improve speed will be printed, etc. The
default value is
1, so raising the value for any standard
quality above its default enables notes for that quality. If
3, then all notes and most
non-serious warnings are inhibited. This is useful with
declare to suppress warnings about unavoidable problems.