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
Chris Uppal  
View profile
 More options 14 Jun 2005, 09:19
Newsgroups: comp.lang.java.programmer
From: "Chris Uppal" <chris.up...@metagnostic.REMOVE-THIS.org>
Date: Tue, 14 Jun 2005 09:19:36 +0100
Local: Tues 14 Jun 2005 09:19
Subject: Re: Optimise my ray tracer

Dale King wrote:
> You know I've been indoctrinated in the Java is as fast as C as well,
> but someone was pointing out benchmarks that show it is twice as slow as
>   compiling the code with gcj. I've not had time to look into the actual
> results (and I haven't found any comparing to 1.5), but it makes me
> wonder if maybe we've believed something that isn't true.

Depends on what you're doing -- obviously.  There have been various reports of
differences in performance with various JVMs vs. various "other" languages.
The results are varied as well.

I do suspect, though, that applications that show Java to be in the 50%-80% as
fast as C/C++/Fortran are probably under-reported.   Java turning out to be as
fast or faster than the old-school languages is news; Java turning out to be
significantly slower is also news; but Java turning out to be slower by an
unimportant margin... <yawn/>

In this particular case, though, I suspect that the results are not
representative -- I did measure the OP's earlier version of the Java code vs.
the C++ code he had on his web page (I had to fix some minor differences), and
found that on my machine the 1.5 server JVM from Sun was getting on for twice
as fast as the C++ code compiled with MS VC6 or VS2003 [*].  He's since offered
modified C++ code, but I haven't attempted to see what the differences are, nor
whether the Java code could still be considered to be a fair equivalent.

    -- chris

([*] to be honest, that surprised me -- I'd have expected the overhead of
heap-allocating hundreds of millions of objects to have more impact than that)


    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