Windows package built w/ CCL



Maxima sometimes works around slowness in GCL. Maybe the following has
been improved in GCL (but not in 2.6.8). In short, GCL is sometimes
slow with rational addition, but the same calculation in Maxima is
much faster.

First with GCL:

(%i1) showtime : all$

(%i2) :lisp(defun $hsum_cl (n) (let ((s 0)) (while (> n 0) (setq s (+ s (/ 1 n))) (decf n)) (to s)))
$HSUM_CL

Super slow:

(%i2) hsum_cl(10000)$
Evaluation took 136.2400 seconds (136.2400 elapsed)

(%i3) hsum_max(n) := block([s : 0], while n > 0 do (s : s + 1/n, n : n-1),s)$

Much faster:

(%i4) hsum_max(10000)$
Evaluation took 0.4800 seconds (0.4800 elapsed)

(%i5) build_info();
Maxima version: 5.23.2
Maxima build date: 11:22 2/2/2011
Host type: i686-pc-mingw32
Lisp implementation type: GNU Common Lisp (GCL)
Lisp implementation version: GCL 2.6.8
Evaluation took 0.0000 seconds (0.0000 elapsed)
(%o5) 

Second with CCL--the CL version and the Maxima version run in about the same time.

(%i1) showtime : all$

(%i2) :lisp(defun $hsum_cl (n) (let ((s 0)) (while (> n 0) (setq s (+ s (/ 1 n))) (decf n)) (to s)))
$HSUM_CL

(%i2) hsum_cl(10000)$
Evaluation took 0.4850 seconds (0.4890 elapsed)

(%i3) hsum_max(n) := block([s : 0], while n > 0 do (s : s + 1/n, n : n-1),s)$

(%i4) hsum_max(10000)$
Evaluation took 0.8740 seconds (0.8800 elapsed)

(%i5) build_info();
Maxima version: 5.23.2
Maxima build date: 20:27 2/27/2011
Host type: i686-pc-mingw32
Lisp implementation type: Clozure Common Lisp
Lisp implementation version: Version 1.7-dev-r14645M-trunk  (WindowsX8632)

--Barton