ECL ignores declarations?
- From: Francogrex <franco@xxxxxxxx>
- Date: Tue, 7 Jul 2009 09:40:58 -0700 (PDT)
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))
.
- Follow-Ups:
- Re: ECL ignores declarations?
- From: fortunatus
- Re: ECL ignores declarations?
- From: Rainer Joswig
- Re: ECL ignores declarations?
- From: Pascal J. Bourguignon
- Re: ECL ignores declarations?
- Prev by Date: Re: LISP vs HASKELL vs PROLOG
- Next by Date: Re: ECL ignores declarations?
- Previous by thread: ◘╃◘╃◘ Cool !!! Cheap *** Fashion Brand Sunglass Adidas,Armani,Burberry,Chanel,Coach,D&G,Dior,Diesel,ED,LV,Gucci,Rayban,Nike,Okely,etc.Welcome to site www.guomeitrade.com Free Shipping ***
- Next by thread: Re: ECL ignores declarations?
- Index(es):