next up previous contents
Next: 5.12.2 Avoid Unnecessary Consing Up: 5.12 General Efficiency Hints Previous: 5.12 General Efficiency Hints

5.12.1 Compile Your Code

 

At this point, the advantages of compiling code relative to running it interpreted probably need not be emphasized too much, but remember that in CMU Common Lisp, compiled code typically runs hundreds of times faster than interpreted code. Also, compiled (fasl) files load significantly faster than source files, so it is worthwhile compiling files which are loaded many times, even if the speed of the functions in the file is unimportant.

Even disregarding the efficiency advantages, compiled code is as good or better than interpreted code. Compiled code can be debugged at the source level (see chapter 3), and compiled code does more error checking. For these reasons, the interpreter should be regarded mainly as an interactive command interpreter, rather than as a programming language implementation.

Do not be concerned about the performance of your program until you see its speed compiled. Some techniques that make compiled code run faster make interpreted code run slower.



Raymond Toy
Mon Jul 14 09:11:27 EDT 1997