Once you have delivered your application at level 0 and tested that it works, you may want to try to make it smaller.
An entire Common Lisp system, and other supporting code, remains in a standalone image delivered at delivery level 0. A good deal of this can usually be removed.
What can be removed depends on the needs of the application. Few applications use all the facilities in the basic image. For instance, if the application does not use any complex numbers, all the code in the image for working with complex numbers can be deleted.
You can specify that the image be made smaller in two complementary ways:
This is the simplest way to make the image smaller. As you increase the delivery level, delivery employs different and increasingly severe strategies.
deliver
.This is a more complicated way to control image size, and should only be resorted to if there are problems or not enough savings can be achieved by simply increasing the delivery level. These keywords are documented in Keywords to the Delivery Function.
These two approaches are based upon the same mechanism: delivery levels are in fact nothing more than different combinations of keyword parameters. But when you specify a delivery level and at the same time pass keyword values, the values you pass override any settings forced by the delivery level.
As an example of how explicit directions to Delivery can be necessary for effective delivery, consider the general addition function, +
. The internal representation of the function contains references to functions that carry out complex number arithmetic, since +
has to use them if it is given complex arguments. If you know your application does not ever pass complex arguments to +
, you should probably remove those functions from the delivered image.
Delivery cannot decide for itself that you do not pass +
any complex arguments, and so does not delete the complex number functions. You can tell Delivery to do so explicitly, by passing :keep-complex-numbers nil
to deliver
. (See page :keep-complex-numbers for a discussion of this keyword.)
LispWorks Delivery User Guide - 10 Aug 2017