Newsgroups: comp.lang.java.programmer
From: Jon Harrop <use...@jdh30.plus.com>
Date: Sat, 11 Jun 2005 01:56:16 +0100
Local: Sat 11 Jun 2005 01:56
Subject: Re: Optimise my ray tracer
Chris Smith wrote: Running my ray tracer. > Jon Harrop <use...@jdh30.plus.com> wrote: >> Can you elaborate on this? All of my tests indicate that Java is many >> times slower than most other modern languages, even stereotypically slow >> languages like SML and OCaml. > You're making statements that are far too broad to be useful. Java is > Most computational tasks tend to run within about 10% to 20% of optimal If you're trying to say that equivalent programs written in different > time for the hardware platform, and compare about evenly with modern > compiled languages. languages like C, C++, Java, SML, OCaml and Fortran will be within 20% of each other's performance then that definitely isn't true. Any programs which stress allocation/deallocation (e.g. balanced binary trees) are likely to do significantly worse in garbage collected languages. Any programs which stress indirected data structures will do significantly worse in OCaml, particularly when pointers cost 64 bits. > There are specific tasks for which significant Here are the times for running my ray tracer on x86 (1.2GHz Athlon T-bird) > general performance differences may be measured (floating point > calculations being one, but I can't recall whether Java is typically > faster or slower here, and it may depend on the platform), but this > wouldn't be described as "many times slower". with n=128, level=6 and ss=4: Mlton 1.250s mlton ray.sml as you can see, Java run under Sun's J2SE is over 5x slower than the fastest > I strongly suspect that the issue is startup time. I have taken many measurements for different running times (<2s to >20s) and, assuming Java's startup time to be constant, the startup time is insignificant. > If you're measuring Right, well I've accounted for that and I can still only conclude that Java > it with your ray tracer, are you measuring externally so as to include > the startup time, or internally once the VM has started? There's no > "right" way to do this; it depends on whether your target audience will > care about startup time, or only how the appo performs once it's > running. However, if you're including startup time, you ought to at > least add a note that this is the reason for the results. The great > majority of applications run for orders of magnitude longer than the > average benchmark, and just saying that Java is slower is very > misleading. is very slow. I've also run the ray tracer on AMD64 with JDK 1.5 and Java is still -- 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.
| ||||||||||||||