Message from discussion
Ray tracer in Stalin
Path: g2news1.google.com!news3.google.com!news.glorb.com!blackbush.cw.net!cw.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsfeed.freenet.de!nntp-peering.plus.net!ptn-nntp-feeder01.plus.net!ptn-nntp-spool01.plus.net!ptn-nntp-reader03.plus.net!not-for-mail
Message-ID: <42ff63bb$0$97128$ed2619ec@ptn-nntp-reader03.plus.net>
From: Jon Harrop <use...@jdh30.plus.com>
Subject: Ray tracer in Stalin
Newsgroups: comp.lang.scheme
Date: Sun, 14 Aug 2005 16:28:32 +0100
Organization: Flying Frog Consultancy Ltd.
User-Agent: KNode/0.8.2
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
Lines: 49
NNTP-Posting-Host: 80.229.56.224
X-Trace: 1124033467 ptn-nntp-reader03.plus.net 97128 80.229.56.224:39839
I've just done a little benchmarking of the ray tracer written in Scheme and
compiled using Stalin. Here are the results. On x86 (900MHz Athlon T-bird):
$ g++ -O3 -march=athlon-tbird -ffast-math ray.cpp -o ray
$ time ./ray 6 160 >image.pgm
real 0m2.152s
$ mlton ray.sml
$ time ./ray 6 160 >image.pgm
real 0m2.435s
$ ocamlopt -inline 100 -ffast-math ray.ml -o ray
$ time ./ray 6 160 >image.pgm
real 0m3.255s
$ stalin -d0 -d1 -d5 -d6 -On -q -d -architecture IA32-align-double
-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
On AMD64 (1.8GHz Athlon64):
$ g++ -O3 -march=athlon-tbird -ffast-math ray.cpp -o ray
$ time ./ray 6 160 >image.pgm
real 0m0.987s
$ mlton ray.sml
$ time ./ray 6 160 >image.pgm
real 0m1.056s
$ ocamlopt -inline 100 -ffast-math ray.ml -o ray
$ time ./ray 6 160 >image.pgm
real 0m1.037s
$ stalin -d0 -d1 -d5 -d6 -On -q -d -architecture IA32-align-double
-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
I hadn't expected a simple Lisp or Scheme implementation to be able to
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