| |
comp.lang.scheme |
I've just done a little benchmarking of the ray tracer written in Scheme and $ g++ -O3 -march=athlon-tbird -ffast-math ray.cpp -o ray $ mlton ray.sml $ ocamlopt -inline 100 -ffast-math ray.ml -o ray $ stalin -d0 -d1 -d5 -d6 -On -q -d -architecture IA32-align-double On AMD64 (1.8GHz Athlon64): $ g++ -O3 -march=athlon-tbird -ffast-math ray.cpp -o ray $ mlton ray.sml $ ocamlopt -inline 100 -ffast-math ray.ml -o ray $ stalin -d0 -d1 -d5 -d6 -On -q -d -architecture IA32-align-double I hadn't expected a simple Lisp or Scheme implementation to be able to --
compiled using Stalin. Here are the results. On x86 (900MHz Athlon T-bird):
$ time ./ray 6 160 >image.pgm
real 0m2.152s
$ time ./ray 6 160 >image.pgm
real 0m2.435s
$ time ./ray 6 160 >image.pgm
real 0m3.255s
-no-clone-size-limit -split-even-if-no-widening -copt -O2 -copt
-fomit-frame-pointer -copt -malign-double ray
$ time ./ray 6 160 >image.pgm
real 0m3.712s
$ time ./ray 6 160 >image.pgm
real 0m0.987s
$ time ./ray 6 160 >image.pgm
real 0m1.056s
$ time ./ray 6 160 >image.pgm
real 0m1.037s
-no-clone-size-limit -split-even-if-no-widening -copt -O2 -copt
-fomit-frame-pointer -copt -malign-double ray
$ time ./ray 6 160 >image.pgm
real 0m1.773s
compete in terms of performance but only 70% slower on 32-bit AMD64 when
C++ and OCaml are fully 64-bit is very impressive, IMHO.
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com