[cmucl-imp] Interesting loop problem

Blake McBride blake1024 at gmail.com
Thu Aug 6 04:27:02 UTC 2015


Greetings,

I was running some test code to (stupid) test the speed of various lisp
implementation including those other than CL.  The code I used is as
follows:

(defun count2 (n)
  (prog ((i 0))
   loop
   (and (eql i n) (return))
   (setq i (+ i 1))
   (go loop)))

I know the code is terrible, but it was a bit more portable over various
lisp dialects.  It ran fine on CLISP, SBCL, ABCL, CCL, GCL, ECL, and
LISPF4, but not CMUCL.

CMUCL ran the code compiled but not interpreted.
Try this interpreted:  (count2 80000000) ; 80M

I get:

; [GC threshold exceeded with 12,013,152 bytes in use.  Commencing GC.]
; [GC completed with 106,440 bytes retained and 11,906,712 bytes freed.]
; [GC will next occur when at least 12,106,440 bytes are in use.]
; [GC threshold exceeded with 12,122,352 bytes in use.  Commencing GC.]
; [GC completed with 114,616 bytes retained and 12,007,736 bytes freed.]
; [GC will next occur when at least 12,114,616 bytes are in use.]
; [GC threshold exceeded with 12,124,080 bytes in use.  Commencing GC.]
.....

I am running 20F on Linux.

Thanks.

Blake McBride


More information about the cmucl-imp mailing list