[Larceny-users] fixnum math

Ray Racine ray.racine at gmail.com
Sun Sep 21 18:40:12 EDT 2008


fx math is unexpectedly slower.

(define times 100000000)

'std-math

(time
 (let ((v (make-vector 2)))
   (vector-set! v 1 2)
   (do ((n times (- n 1)))
       ((zero? n) (vector-ref v 1))
     (vector-ref v 1))))

'fx-math

(time
 (let ((v (make-vector 2)))
   (vector-set! v 1 2)
   (do ((n times (fx- n 1)))
       ((fxzero? n) (vector-ref v 1))
     (vector-ref v 1))))
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the Larceny-users mailing list