Re: Java outperforms C++?
- From: "$Scott" <$Scott@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 15 Apr 2005 03:06:28 +0100
"Bo Persson" <bop@xxxxxx> wrote in message
news:eJcqHiRQFHA.1096@xxxxxxxxxxxxxxxxxxxxxxx
>
> "$Scott" <$Scott@xxxxxxxxxxxxxxxxxx> skrev i meddelandet
> news:d3m119$c0h$1$8302bc10@xxxxxxxxxxxxxxxxxxx
> >
> > "Jerry Coffin" <jcoffin@xxxxxxxxx> wrote in message
> > news:MPG.1cc643e4e0fc63ae989697@xxxxxxxxxxxxxxxxxxxxx
> >> In article <d3gl8d$q21$1$8300dec7@xxxxxxxxxxxxxxxx>,
> >> $Scott@xxxxxxxxxxxxxxxxxx says...
> >>
> >> [ ... ]
> >>
> >> > I'm not surprised, Java is faster than most people think. See:
> >> > http://kano.net/javabench/
> >>
> >> See:
> >>
> >> http://tinyurl.com/66dy5
> >>
> >> For a commentary on some of this code. I believe I was looking at the
> >> code on a different site at the time, but it appears identical
> >> anyway. I should also note that on the hash test, if you use sprintf
> >> instead of a stringstream in C++, its time drops to 0.7 seconds (i.e.
> >> the C++ version runs close to twice as fast as the Java version).
> >>
> >> > There are a number of good technical reasons why Java is faster
> >> > see:
> >> > http://www.idiom.com/~zilla/Computer/javaCbenchmark.html
> >>
> >> When you're done marveling at his results, see:
> >>
> >> http://tinyurl.com/3qlxd
> >>
> >> for a short note about how they came about.
> >>
> >> If you don't want to bother with that, I'l summarize: the "technical
> >> reason" that C++ didn't trounce Java in these tests was simply that
> >> the C++ in question was _terribly_ written.
> >>
> >
> > I don't see the connection. The link you quote talks about 'lines
> > 215-222 of
> > his life benchmark' and rightly criticizes some inefficient C code.
> > However
> > I cannot find such a benchmark mentioned in the article. Neither could
> > I
> > find any mention of such a benchmark on the web site
> > (http://www.idiom.com/~zilla/). I'll be more than happy if you can
> > show a
> > connection between the article you quote and the article by Lewis and
> > Neumann but as far as I can see they are unrelated, in which case it
> > is hard
> > to see how criticizing someone else's code invalidates the technical
> > reasons why Java outperformed C++.
>
> His examples shows that it is *possible* to write C++ code that runs
> slower than some Java code.
It is possible to write slow code - what a trivial observation! It has
absolutely no relevance to which language is faster. Nor does it appear to
have any connection to any benchmark in Lewis and Neumann's paper. Nor does
it invalidate their reasons for why Java turns out to be faster.
>How does that prove that Java is faster?
Go back and read what I said a bit more carefully, then read Lewis and
Neumann's paper and understand why pointer optimization is so difficult in
C++ compared to Java array bounds checking, why garbage collection has
better cache performance than new/malloc and why run-time compilation offers
optimizations which a conventional "pre-compiler" cannot do. These are the
reasons why Java often outperforms C++.
.
- Follow-Ups:
- Re: Java outperforms C++?
- From: Bo Persson
- Re: Java outperforms C++?
- From: Jerry Coffin
- Re: Java outperforms C++?
- From: Nemanja Trifunovic
- Re: Java outperforms C++?
- References:
- Java outperforms C++?
- From: benben
- Re: Java outperforms C++?
- From: $Scott
- Re: Java outperforms C++?
- From: Jerry Coffin
- Re: Java outperforms C++?
- From: $Scott
- Re: Java outperforms C++?
- From: Bo Persson
- Java outperforms C++?
- Prev by Date: Re: How to use initialization list?
- Next by Date: error - type cast
- Previous by thread: Re: Java outperforms C++?
- Next by thread: Re: Java outperforms C++?
- Index(es):
Relevant Pages
|