7 Aug 2009 19:16
how to optimize for speed in SBCL
David A. Ventimiglia <ventimig <at> msu.edu>
2009-08-07 17:16:50 GMT
2009-08-07 17:16:50 GMT
Hi! How exactly does one use (declare (optimize (speed 3) (safety0))), as in the following code example, which is adapted from the last chapter in "Practical Common Lisp"? (defun add (x y) (declare (optimize (speed 3) (safety 0))) (declare (double-float x y)) (the double-float (+ x y))) In Peter Seibel's book, x and y are fixnums, which seems to work ok in SBCL. With double-floats, however, it emits this note: note: doing float to pointer coercion (cost 13) to "<return value>" Not a huge deal for me, but I'm just trying to figure out how all these things work. All the best, David -- -- David A. Ventimiglia <ventimig <at> msu.edu> Michigan State University ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on(Continue reading)
RSS Feed