> (defun test ()
> (let* ((dim 2) (n 100) ; !! 1000
> (dims (make-fixnum-vec dim n))
> (offsets (fixnum-vec 1 n))
> (entries (make-double-vec (expt n dim) 1.0d0))
> (pos0 0))
> (declare (optimize (speed 3) (safety 0) (debug 0)))
> (declare (type fixnum pos0)
> (type fixnum-vec dims offsets)
> (type double-vec entries))
> (loop with offset of-type uint = (aref offsets 0)
> for pos1 of-type uint from (the uint (+ pos0 offset)) by offset
> below (the uint (+ pos0 (the uint (* offset (the uint (- (aref dims 0) 1))))))
> do
> (loop with offset of-type uint = (aref offsets 1)
> for pos2 of-type uint from (the uint (+ pos1 offset)) by offset
> below (the uint (+ pos1 (the uint (* offset (the uint (- (aref dims 1)
>1))))))
> do
> The resulting disassembly is much longer than the disassembly of the C
> code and the code performs a factor 10 worse.
Hm. Suppose that's perhaps one of the secret reasons why I never used any
LOOP construct in my code. ;-)
--
regards, [EMAIL PROTECTED] (o_
Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU)