Thanks for the info. When I use those declarations, the scheme version still lags by about 4-5 seconds. I'm compiling the scheme code like this
$ gsc isort.scm $ gcc -O2 -D___SINGLE_HOST -o isort isort.c isort_.c -lgambc -lm -ldl -lutil
I haven't used gambit much, so maybe this is not optimal.
Regards,
Ben
On Sat, 11 Dec 2004 18:55:45 -0500, Guillaume Germain guillaume@nulko.com wrote:
dev null wrote:
For 100_000 elements, my laptop executes the C version in 11 secs and the scheme code in 20 secs.
I have very similar timing results on my computer. Adding the following declarations to the top of the Scheme file reduces the running time from 20.5s to 11.4s (that is about as fast as C):
(declare (standard-bindings) (block) (not safe) (fixnum) (extended-bindings) (inline) (inlining-limit 10000) (lambda-lift) (constant-fold))
I don't know why the u32-vector version is slower.
Guillaume