On Mon, Oct 27, 2003 at 08:07:31PM -0500, Michael Naunton wrote:

A question phrased as a thought:

> (defun bar (i)
>   (declare (type fixnum i))
>   (declare (values double-float))
>   (let ((x 0d0))
>     (loop for j fixnum from 0 to i
>         do (setf x (the double-float (+ x (foo)))))
>     x))

I at some point observed strange slowdowns as I added declarations --
not generally, but when I declared things with THE. I gathered from
this (without due investigation) that each the ment an additional
typecheck regardless of safety. Don't know if that's really true.

But it did seem to me that adding THE was worth the trouble only when
the compiler obviously had trouble.

Also, declaring (space 0) can be helpful, since more things get inlined.

Cheers,

 -- Nikodemus

Reply via email to