This is the mail archive of the guile@cygnus.com mailing list for the guile project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Hi all! I am a beginning Scheme programmer. Recently I tested several Scheme interpreters to decide which one I should use. I wrote two nested tail-recursive loops and I counted the iterations of outer loop during 1 minute since executing (load "loop-test.scm"). The test program (a rather stupid one) is attached. Results were the following: SCM 5d0 625 MzScheme 53 535 (.scm) 1063 (.so) SIOD 3.5 109 Guile 1.3 70 So I decided to use MzScheme (http://www.cs.rice.edu/CS/PLT/packages/mzscheme/), because it is embeddable within C programs like Guile (and it has excellent documentation). What makes me worry as a GNU fan, is that Guile had the worst performance. Andres.
(let ((circular-list ((lambda (p) (set-cdr! (letrec ((loop (lambda (p) (if (null? (cdr p)) p (loop (cdr p)))))) (loop p)) p) p) (list "-" "-" "*")))) (letrec ((loop (lambda (i) (letrec ((loop (lambda (i) (if (< i 10000) (begin (set! circular-list (cdr circular-list)) (loop (+ i 1))))))) (loop 0)) (if (equal? (car circular-list) "*") (display i) (display (car circular-list))) (force-output) (loop (+ i 1))))) (loop 0)))