All Manuals > Delivery User Guide > 4 Delivering your Application

4.5 How to deliver a smaller and faster application

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.

4.5.1 Making the image smaller

You can specify that the image be made smaller in two complementary ways:

  1. By increasing the delivery level.

    This is the simplest way to make the image smaller. As you increase the delivery level, delivery employs different and increasingly severe strategies.

  2. By specifying what to remove and what to keep, using keyword arguments to 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 5 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 :keep-complex-numbers for a discussion of this keyword.)


Delivery User Guide - 01 Dec 2021 19:35:04