The LispWorks CLOS implementation achieves fast method dispatch by producing a compiled function for all method combinations used in the application. Since necessary method combinations can often only be determined by seeing what arguments a generic function is called with, these functions can often end up being generated and compiled at runtime.
Because delivered application should not contain the compiler, method combination functions generated at runtime cannot be compiled on the fly. A solution to this problem is to use closure-based code to represent the combinations. In addition, the image can make use of many "template" method combination functions, already compiled, from which it can choose when deciding upon the right method combination for a particular call. The correct methods can be plugged into these template functions at runtime. The templates provided can deal with:
The templates included should cover nearly all cases of user-defined method combinations. In those cases where they do not, however, Delivery substitutes closure-based code to do the job.
In most cases the effect on method-dispatch time of using this substitute technique is negligible. Pathological cases might, however, cause a slowdown of 10-20% over compiled method combination functions. Fortunately, you can find out what the correct template would be, return to LispWorks, and pre-compile it.