Java vs C++

djberg96 on 2004-09-13T03:16:15

I've seen a couple threads like this recently.

Sorry, but Java isn't as fast as C++. Oh, sure, it can win some microbenchmarks, but I have yet to see an application that was as fast as C++.

In any case, the real acid test is this - an operating system. Funny, we still don't have an OS written in Java that won't take three more iterations of Moore's Law just to be useable. On the other hand, BeOS (C++) is still more responsive than my Linux desktop.


Stupid Words for Stupid Discussions

chromatic on 2004-09-13T03:53:34

I propose to replace the word "fast" in "X isn't as fast as Y" with "blurgle". After that, replace the word "scale" in "X doesn't scale as well as Y" with "pbibbip". That way, innocent bystanders who'd normally find these arguments convincing can realize that statements such as "Java isn't as blurgle as C++" and "Perl doesn't pbibbip as well as Java" are completely useless.

Quote me on this.

Re:Stupid Words for Stupid Discussions

rafael on 2004-09-13T07:05:44

You must be joking, pbibbip isn't even pronounceable. To be a doubleplusgood duckspeaker, you must use words that are easy to speak without even noticing.

Re:Stupid Words for Stupid Discussions

chromatic on 2004-09-13T15:10:47

The fact that you have to spit -- a lot -- while trying to pronounce it is a feature.

Lies and Meaningless Statistics

ziggy on 2004-09-13T04:17:01

On the other hand, BeOS (C++) is still more responsive than my Linux desktop.
BeOS' responsiveness has nothing to do with its use of C++ as an implementation language. You could reimplement Linux and C++ and it wouldn't magically become more responsive.

When comparing two systems for speed/scalability, the only thing you can reasonably compare are the design and engineering of those systems. In every case, the better designed/better built system will be faster and more scalable. Period. The language of implementation is irrelevant.

What the BeOS/Linux comparison highlights is that BeOS is the first OS to be built with a fresh design that assumes it will run on modern hardware architectures, and presumes that it will need to support a GUI and heavy realtime digital media usage. Linux, on the other hand, is a 30+ year old OS design that was created to express a design that is inherently cross platform.

The Java/C++ comparsions are meaningless because they encompass too many engineering and design decisions all at once -- VM vs. machine code, differences in standard libraries, differences in library models that bleed through into the application, differences in application design philosophies, and low level details such as threading issues and cache coherency. At the end of the day, it's like making a vague generalization from comparing a Ford Explorer against a Volkswagen GTI and trying to infer whether manual or automatic transmissions are "faster".

Re:Lies and Meaningless Statistics

djberg96 on 2004-09-13T10:56:34

BeOS' responsiveness has nothing to do with its use of C++ as an implementation language.

So, if BeOS had been implemented in Java it would have been just as fast? You'll never convince me of that. But, yes, I understand your point about architecture.

Re:Lies and Meaningless Statistics

chromatic on 2004-09-13T15:19:20

I'm always a little suspicious of arguments based on benchmarks no one ran on code that doesn't exist!

Re:Lies and Meaningless Statistics

djberg96 on 2004-09-13T15:22:27

By all means, whip up JavaOS and we'll benchmark. Let me know how it goes.

Re:Lies and Meaningless Statistics

chromatic on 2004-09-13T16:08:11

I don't particularly care if JaOS is faster than CppOS. I do care, though, that people use meaningful data if they compare various languages and platforms.

Java vs. C++

zatoichi on 2004-09-13T11:48:35

Java was not adopted by a huge amount of developers because of its "speed". That it IS getting speedier is nothing but a good thing.

Re:Java vs. C++

educated_foo on 2004-09-13T14:23:54

You mean "that it was adopted was the best thing that happened to compiler researchers' funding since FORTRAN"...

Re:Java vs. C++

zatoichi on 2004-09-13T14:26:58

FORTRAN? What's that? ;-)