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
Jon Harrop  
View profile
 More options 11 Jun 2005, 17:40
Newsgroups: comp.lang.java.programmer
From: Jon Harrop <use...@jdh30.plus.com>
Date: Sat, 11 Jun 2005 17:40:42 +0100
Local: Sat 11 Jun 2005 17:40
Subject: Re: Optimise my ray tracer

Lasse Reichstein Nielsen wrote:
> Jon Harrop <use...@jdh30.plus.com> writes:
>> I have taken startup time into consideration. Java is still consistently
>> many times slower than most other languages.

> Is this using the original code that was posted here? Because it can
> be written significantly better.

Great, tell me how (provided it doesn't get too much longer).

> Just making the Vector class static will reduce its number of fields
> by 25%, which should make a significant cut in the initialization time
> for each Vector.

One my machine, the original took 31s for:

$ javac ray.java
$ java ray 256>image.pgm

With the vector class declared static (what exactly does this do?) it takes
29s, which is not significantly faster.

In contrast, Mlton-compiled SML is much shorter (79 vs 110 LOC) and runs
about 5x as fast, taking only 6s to ray trace exactly the same image.

So we really need much better optimisations if Java is going to perform
anything like as well as the other languages. Am I missing something
simple, like JIT or optimisation flags?

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

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