I came across this post talking about numerical speed in Clojure, so I thought I would try out the equivalent in Common Lisp (Clozure CL) on my Macbook:
CL-USER> (let* ((arr-size 3000000) (double-arr (make-array arr-size :element-type 'single-float))) (dotimes (i arr-size) (setf (aref double-arr i) (random 1.0))) (time (loop for i from 0 below arr-size summing (aref double-arr i)))) (LOOP FOR I FROM 0 BELOW ARR-SIZE SUMMING (AREF DOUBLE-ARR I)) took 45,649 microseconds (0.045649 seconds) to run. During that period, and with 4 available CPU cores, 45,558 microseconds (0.045558 seconds) were spent in user mode 57 microseconds (0.000057 seconds) were spent in system mode 1500183.5
So — 45 milliseconds
, not bad.