Re: Java outperforms C++?
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Tue, 12 Apr 2005 06:49:51 -0700
benben wrote:
> I have taken C++'s speed for granted for years, so I was stunned by
> the table of Cost of Common Operations between C++ and Java on page
> 601 of Code Complete 2nd Edition by Steve McConnell. It seems, as
> shown in the table, that Java outperforms C++ in every criteria, if
> not merely matches the latter.
>
> Is that I am reading the table the wrong way? or my previous
> assumption has been so wrong? or the author had the columns reversed?
Read the footnote on the table:
<quote>
....Measurements between C++ and Java are not directly comparable.
</quote>
The reason for the apparent skew in Java's favor is that this is a table of
_relative_ performance, based in i=j as the base operation. In the real
world, that base operation in Java (or C#) is quite a lot slower than the
equivalent base operation in C++, once you factor in JIT time, etc.
While I'm a big fan of Code Complete, I don't think this table is
particularly useful. If you look at the previous table on page 600 you'll
see that Mr., McConnell measured Java os 1.5 times slower than C++ on
average.
-cd
.
- References:
- Java outperforms C++?
- From: benben
- Java outperforms C++?
- Prev by Date: Re: C++ compiler bug creates corrupted library
- Next by Date: Re: How to allow Warning level about from 'unsigned char *' to 'const char *'
- Previous by thread: Re: Java outperforms C++?
- Next by thread: Re: Java outperforms C++?
- Index(es):