Newsgroups: comp.lang.java.programmer
From: Lasse Reichstein Nielsen <l...@hotpop.com>
Date: Sat, 11 Jun 2005 19:54:58 +0200
Local: Sat 11 Jun 2005 18:54
Subject: Re: Optimise my ray tracer
Jon Harrop <use...@jdh30.plus.com> writes: I posted a link to a slightly optimized version. I don't know if > 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 > Great, tell me how (provided it doesn't get too much longer). I am changing the algorithm too much for comparison (e.g., moving loop invariant code out of the loop) and doing all the I/O at the end instead of during the computation. <URL: http://www.infimum.dk/privat/RayTracing.java > I admit to having performed "optimizations" without profiling first, > With the vector class declared static (what exactly does this do?) It makes the class more independent of the surrounding class, so each Vector doesn't have to carry around a reference to a "ray" object that it never uses. In a real program, I would put all the nested classes into their own > it takes 29s, which is not significantly faster. My guess is that a lot of the time comes from I/O (ok, just O, it only does output :). > In contrast, Mlton-compiled SML is much shorter (79 vs 110 LOC) and runs Brevity of code is not in itself a quality. Java is often more verbose > about 5x as fast, taking only 6s to ray trace exactly the same image. than other languages, but I also often find it more readable, because differet programmers can't invent their own dialect. > So we really need much better optimisations if Java is going to perform Can't help you there. I rarely fiddle with flags :) > anything like as well as the other languages. Am I missing something > simple, like JIT or optimisation flags? Btw, is the generated image correct? It looks odd. 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.
| ||||||||||||||