Message from discussion
Optimise my ray tracer
Path: g2news1.google.com!news4.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!newsfeeder1.noc.eunet-ag.at!news.eunet.at!newsfeed.utanet.at!zen.net.uk!dedekind.zen.co.uk!news.anlx.net!caladan!bbc!news-peer-lilac.gradwell.net!nntp-peering.plus.net!ptn-nntp-feeder01.plus.net!ptn-nntp-spool02.plus.net!ptn-nntp-spool03.plus.net!ptn-nntp-reader04.plus.net!not-for-mail
Message-ID: <42aad330$0$2038$ed2e19e4@ptn-nntp-reader04.plus.net>
From: Jon Harrop <use...@jdh30.plus.com>
Subject: Re: Optimise my ray tracer
Newsgroups: comp.lang.java.programmer
Date: Sat, 11 Jun 2005 13:03:02 +0100
References: <429e5795$0$7560$ed2619ec@ptn-nntp-reader03.plus.net> <9c838fb.0506021056.7fdfc1be@posting.google.com> <1118360978.847065.245350@g47g2000cwa.googlegroups.com> <42aa2272$0$41906$ed2619ec@ptn-nntp-reader03.plus.net> <umzpxmmyc.fsf@hotmail.com>
Organization: Flying Frog Consultancy Ltd.
User-Agent: KNode/0.8.2
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
Lines: 27
NNTP-Posting-Host: f9b0ddc7.ptn-nntp-reader04.plus.net
X-Trace: DXC=E>8`XK@jLK;e>T=;_h\=67igd3Y`7Rb;>3_LeXC3B]S9Hl>I2N\BWC:b3PPPJ7Iic?XGbD9U[nCd:Bldn\`LXYo7
X-Complaints-To: abuse@plus.net
Tor Iver Wilhelmsen wrote:
> Jon Harrop <use...@jdh30.plus.com> writes:
>> 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.
>
> Since Java code (unless forced to run interpreted) runs 98% of its
> time as run-time optimized native code, how can it be slower than
> compile-time optimized C code?
Many possible reasons:
1. Java's optimiser isn't as good.
2. The time spent optimising is longer than the time saved executing.
3. Deficiencies in the language (of which there are many in Java, e.g.
run-time checks due to OO, boxing).
4. Poor implementations of performance critical constructs by the compiler,
e.g. recursion.
> Are you perchance taking startup time into consideration?
I have taken startup time into consideration. Java is still consistently
many times slower than most other languages.
--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com