Re: Java outperforms C++?
- From: "Rob Vermeulen" <rvermeulen@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 15:45:09 +0200
I'm spamming this newsgroup a lot, today...The topic attracted my attention
:-)
It's true that managed versus unmanaged code does not mean respectively slow
versus fast code.
But I can't imagine Java outperforming C++ on _every_ criterium. I need to
get that book, then. (I haven't read a word of it, yet).
As Joel Spolsky already mentioned in one of his articles, every code is
somewhat managed. Ever thought of the things "malloc" does before returning
a pointer to a segment?
Constantly allocating memory in unmanaged (C++) code results in poorer
performance every time you do a malloc, while managed code's performance
stays theoretically equal.
Ofcourse, if you are an experienced coder, you have created memory pool
classes and you're reusing memory blocks instead of freeing and allocing
again. The advantage of managed code is that you don't have to do the effort
again of building memory pools.
But again, I need to see it with my own eyes before I can start to believe
the story about Java outperforming C++. What compiler did they use? Did
they compare recursive C++ functions with iterative Java calls?
> What about C# and Java ?
Ok, first thing: I think you meant .NET and Java? Because there's no
performance difference when VB.NET or C#.NET.
The advantage that .NET has to Java is that the MS-developers have learned
from Java's mistakes and that the technology is from half a decade later. So
good comparison can't be made.
The biggest advantage .NET has, is the seamless cooperation with non-managed
code and COM objects and its remoting (SOAP) possibilities.
Ok, I got a bit off-topic. Any other views to this topic ?
Cheers,
Rob.
"Shreyas" <Shreyas@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0ECA3FF4-B957-4368-9437-BA3DE367EF01@xxxxxxxxxxxxxxxx
> What about C# and Java ?
>
> "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?
>>
>> ben
>>
>>
>>
.
- References:
- Java outperforms C++?
- From: benben
- RE: Java outperforms C++?
- From: Shreyas
- Java outperforms C++?
- Prev by Date: Re: Managed C++
- Next by Date: Re: Managed C++
- Previous by thread: RE: Java outperforms C++?
- Next by thread: u_char *
- Index(es):
Relevant Pages
|