>>>>> "Robert" == Robert Dodier writes:
Robert> Well, I did this:
Robert> (load "rand-mt19937.lisp")
Robert> (time (dotimes (i 1000000) (mt19937::random 123456)))
Robert> and compared that to: (time (dotimes (i 1000000) (random 123456)))
Robert> But perhaps I should have done this:
Robert> (compile-file "rand-mt19937.lisp")
Robert> (load "rand-mt19937.x86f")
Robert> (time (dotimes (i 1000000) (mt19937::random 123456)))
Robert> That is MUCH faster.
Compiling certainly helps. Note also that CMUCL (and SBCL) has some
compiler knowledge about random so (random 123456) doesn't actually
call the random function that has to do type-dispatch to figure out
what to return. I think it even inlines a part of the mt19937 rng.
I'll try to take a look at this sometime soon.
Robert> Incidentally, Clisp barfs on (compile-file "rand-mt19937.lisp") --
Robert> it complains "cannot redefine built-in class # ", although (load "rand-mt19937.lisp") is OK.
Robert> Any idea about how to make Clisp compile happily?
Perhaps some issues with Lisp packages. I can never remember the
necessary magic to shadow an existing Lisp symbol.
Ray