ECL ignores declarations?



Hi, can you tell me what the code below gives on your PC and
implementation? The reason I ask, is because ECL doesn't seem to care
whether the declarations are made or not, the time it takes to get
thru the calculation is the same (around 15 sec on my PC). Thanks
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar a (make-array '(10000 10000)
:element-type ' single-float
:initial-element 1.0s0))

(defun sum-elts (a)
(declare (type (simple-array single-float (10000 10000))
a))
(let ((sum 0.0s0))
(declare (type single-float sum))
(dotimes (r 10000)
(dotimes (c 10000)
(incf sum (aref a r c))))
sum))

(compile 'sum-elts)

(time (sum-elts a))

(defun sum-elts2 (a)
(let ((sum 0.0s0))
(dotimes (r 10000)
(dotimes (c 10000)
(incf sum (aref a r c))))
sum))

(compile 'sum-elts2)

(time (sum-elts2 a))
.


Quantcast