Google Groups Home
Help | Sign in
Message from discussion Optimise my ray tracer
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
Skip  
View profile
 More options 2 Jun 2005, 15:15
Newsgroups: comp.lang.java.programmer
From: "Skip" <a...@b.invalid>
Date: Thu, 2 Jun 2005 16:15:36 +0200
Local: Thurs 2 Jun 2005 15:15
Subject: Re: Optimise my ray tracer
"Jon Harrop" <use...@jdh30.plus.com> wrote in message

news:429e5795$0$7560$ed2619ec@ptn-nntp-reader03.plus.net...

> I've written a mini ray tracer for the computer language shootout. The
> original version was written in OCaml which I ported to C++:

>   http://www.ffconsultancy.com/free/ray_tracer/comparison.html

> I have since ported the program to several other languages, including
Java.
> Currently, the Mlton-compiled SML, OCaml, C++ and Fortran are the fastest,
> and Java trails a long way behind. I am concerned that this is because I
am
> a much better OCaml/C++ than Java programmer so I'm asking for advice
here.

The first run of this code is done in interprete-mode. If you run it a few
times, things get faster. Here is my benchmark (with n=32)

iteration #0: 474.3ms
iteration #1: 198.0ms
iteration #2: 151.1ms
iteration #3: 154.9ms
iteration #4: 153.1ms
iteration #5: 155.9ms
iteration #6: 149.5ms
iteration #7: 149.3ms

P4 2.4GHz (running at 1.8GHz)

What kinds of differences do you see for n=32 in calc-duration, comparing
Java and C++?


    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.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google