Google Groups Home
Help | Sign in
Ray tracer in Stalin
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 47 - Collapse all   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jon Harrop  
View profile
 More options 14 Aug 2005, 16:28
Newsgroups: comp.lang.scheme
From: Jon Harrop <use...@jdh30.plus.com>
Date: Sun, 14 Aug 2005 16:28:32 +0100
Local: Sun 14 Aug 2005 16:28
Subject: Ray tracer in Stalin

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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
matthias.bl...@gmail.com  
View profile
 More options 14 Aug 2005, 16:54
Newsgroups: comp.lang.scheme
From: Matthias.Bl...@gmail.com
Date: 14 Aug 2005 08:54:25 -0700
Local: Sun 14 Aug 2005 16:54
Subject: Re: Ray tracer in Stalin

Jon Harrop wrote:
> I hadn't expected a simple Lisp or Scheme implementation to be able to
> compete [...]

Calling Stalin a "simple" implementation has to be /the/ understatement
of the year!

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ray Dillinger  
View profile
 More options 14 Aug 2005, 17:33
Newsgroups: comp.lang.scheme
From: Ray Dillinger <b...@sonic.net>
Date: Sun, 14 Aug 2005 16:33:25 GMT
Local: Sun 14 Aug 2005 17:33
Subject: Re: Ray tracer in Stalin

Jon Harrop wrote:
> 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.

There are things I don't like about Stalin (related mostly to its
"static" nature and skimpy error handling), but raw speed is one
thing it's terribly good at.  A *LOT* of work has gone into the
Stalin compiler to make it compile code that runs fast.  It is not
an example of a "simple" implementation.

                                Bear


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jon Harrop  
View profile
 More options 14 Aug 2005, 17:46
Newsgroups: comp.lang.scheme
From: Jon Harrop <use...@jdh30.plus.com>
Date: Sun, 14 Aug 2005 17:46:54 +0100
Local: Sun 14 Aug 2005 17:46
Subject: Re: Ray tracer in Stalin

Matthias.Bl...@gmail.com wrote:
> Jon Harrop wrote:
>> I hadn't expected a simple Lisp or Scheme implementation to be able to
>> compete [...]

> Calling Stalin a "simple" implementation has to be /the/ understatement
> of the year!

Ooops! Sorry, I didn't mean to say "simple" there at all. Honestly, I wonder
who typed that... ;-)

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jon Harrop  
View profile
 More options 14 Aug 2005, 17:52
Newsgroups: comp.lang.scheme
From: Jon Harrop <use...@jdh30.plus.com>
Date: Sun, 14 Aug 2005 17:52:45 +0100
Local: Sun 14 Aug 2005 17:52
Subject: Re: Ray tracer in Stalin

Ray Dillinger wrote:
> There are things I don't like about Stalin (related mostly to its
> "static" nature and skimpy error handling), but raw speed is one
> thing it's terribly good at.

As a Lisp/Scheme virgin, I'm finding Stalin much easier going than the other
compilers I've tried (Bigloo, SBCL, CMUCL). Bigloo in particular has the
worst error reporting I've ever seen...

> A *LOT* of work has gone into the
> Stalin compiler to make it compile code that runs fast.  It is not
> an example of a "simple" implementation.

Ahem. Yes, sorry about that.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel C. Wang  
View profile
 More options 14 Aug 2005, 19:44
Newsgroups: comp.lang.scheme
From: "Daniel C. Wang" <danwan...@gmail.com>
Date: Sun, 14 Aug 2005 11:44:37 -0700
Local: Sun 14 Aug 2005 19:44
Subject: Re: Ray tracer in Stalin
{stuff deleted}

> 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.

Stalin is a very sophsticated implementation that uses whole program
compilation algorithms. It's very much like MLton. Chicken Scheme is
what I'd call a "simple" implementation.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kjetil Svalastog Matheussen  
View profile
 More options 14 Aug 2005, 23:44
Newsgroups: comp.lang.scheme
From: Kjetil Svalastog Matheussen <kjet...@notam02.no>
Date: Mon, 15 Aug 2005 00:44:53 +0200
Local: Sun 14 Aug 2005 23:44
Subject: Re: Ray tracer in Stalin

Its a shame theres so much difference. Would be interesting
to see what results cmucl or sbcl gives. Have you posted a
request to comp.lang.lisp?

Anyway, perhaps you could try the following options for stalin? I got
better results with these:

   -d0 -d1 -d5 -d6 -On -k -Ob -Om -Or -Ot -q -d -architecture
IA32-align-double -no-clone-size-limit -split-even-if-no-widening -copt
-O3 -copt -fomit-frame-pointer
-copt -malign-double -copt -ffast-math -copt -freg-struct-return

--


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jens Axel Søgaard  
View profile
 More options 15 Aug 2005, 00:24
Newsgroups: comp.lang.scheme
From: Jens Axel Søgaard <use...@soegaard.net>
Date: Mon, 15 Aug 2005 01:24:51 +0200
Local: Mon 15 Aug 2005 00:24
Subject: Re: Ray tracer in Stalin

Jon Harrop wrote:
> 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.

It is also worth noting the Stalin code has no type declarations.

--
Jens Axel Søgaard


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jon Harrop  
View profile
 More options 15 Aug 2005, 00:42
Newsgroups: comp.lang.scheme
From: Jon Harrop <use...@jdh30.plus.com>
Date: Mon, 15 Aug 2005 00:42:06 +0100
Local: Mon 15 Aug 2005 00:42
Subject: Re: Ray tracer in Stalin

Jens Axel Søgaard wrote:
> Jon Harrop wrote:
>> 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.

> It is also worth noting the Stalin code has no type declarations.

Well, it uses "vec" and "list" but I'm not sure what you'd call a type
declaration.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jon Harrop  
View profile
 More options 15 Aug 2005, 02:14
Newsgroups: comp.lang.scheme
From: Jon Harrop <use...@jdh30.plus.com>
Date: Mon, 15 Aug 2005 02:14:48 +0100
Local: Mon 15 Aug 2005 02:14
Subject: Re: Ray tracer in Stalin

Daniel C. Wang wrote:
> {stuff deleted}
>> 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.

> Stalin is a very sophsticated implementation that uses whole program
> compilation algorithms. It's very much like MLton. Chicken Scheme is
> what I'd call a "simple" implementation.

I just remembered what I meant when I wrote that: "I hadn't expected a
simple implementation of the ray tracer written in Lisp or Scheme to be
able to compete in terms of performance...".

In other words, I was expecting fast Lisp/Scheme implementations of the ray
tracer to be obfuscated compared to the other languages but that doesn't
seem to be the case.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Förster vom Silberwald  
View profile
 More options 15 Aug 2005, 12:27
Newsgroups: comp.lang.scheme
From: "Förster vom Silberwald" <chain_l...@hotmail.com>
Date: 15 Aug 2005 04:27:49 -0700
Local: Mon 15 Aug 2005 12:27
Subject: Re: Ray tracer in Stalin

Jon Harrop wrote:
> 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):

Which Scheme version did you use? Is it the same as the one you used
under Bigloo (except for the +fl, etc. operators).

Schneewittchen


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Förster vom Silberwald  
View profile
 More options 15 Aug 2005, 12:32
Newsgroups: comp.lang.scheme
From: "Förster vom Silberwald" <chain_l...@hotmail.com>
Date: 15 Aug 2005 04:32:06 -0700
Local: Mon 15 Aug 2005 12:32
Subject: Re: Ray tracer in Stalin

Jens Axel Søgaard wrote:
> Jon Harrop wrote:

> > 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.

> It is also worth noting the Stalin code has no type declarations.

There is one bug which hit me: Stalin takes a rather, rather long time
for compiling. Maybe this issue has changed in the meantime. I once
used Stalin on my old laptop under SuSE Linux 8.0 and every program
took at least 33 seconds when compiling. That was rather tedious; at
least for smaller programs.

Schneewittchen


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Förster vom Silberwald  
View profile