Slashdot Mirror


Java Faster Than C++?

jg21 writes "The Java platform has a stigma of being a poor performer, but these new performance benchmark tests suggest otherwise. CS major Keith Lea took time out from his studies at student at Rensselaer Polytechnic Institute in upstate New York's Tech Valley to take the benchmark code for C++ and Java from Doug Bagley's now outdated (Fall 2001) "Great Computer Language Shootout" and run the tests himself. His conclusions include 'no one should ever run the client JVM when given the choice,' and 'Java is significantly faster than optimized C++ in many cases.' Very enterprising performance benchmarking work. Lea is planning next on updating the benchmarks with VC++ compiler on Windows, with JDK 1.5 beta, and might also test with Intel C++ Compiler. This is all great - the more people who know about present-day Java performance, the better.""

4 of 1,270 comments (clear)

  1. I agree. by James+A.+S.+Joyce · · Score: 0, Redundant

    "...the more people who know about present-day Java performance, the better."

    This person will never know how right they were!

  2. this is a joke by kendoka · · Score: 0, Redundant

    gcc doesn't exactly produce the most optimized code - guess he didn't know about that. Oh well - just another java freak trying to justify his poor coding skills. :P

  3. *Can* be faster by miyako · · Score: 1, Redundant

    I didn't RTFM, but from the headline, it seems like the word CAN is the gotcha, any language that has a purpose for existing can be faster than any other languages in certain situations. This is because computers are (generally) better at optomizing code than people.
    But, if this guy is saying that in general Java is faster than C++, I call bullshit. Don't get me wrong, I love Java, and there are a lot of great things about it, but speed ain't one of them.
    With the power of modern computers, java is generally fast enough, but if I'm writing an application to run on my 200mz ram hungry and already overloaded server, then Java is not going to be my langauge of choice.
    I wish people would just get over this programming language pissing contest that seems to have been going on, and promote each language based on it's own merits, and not try to say that any given language is the end all be all of programming.
    In my experience, Java is fast to write, and C++ is fast to run. C++ can be hard to debug, and Java can make it hard to eliminate overhead.
    If one day Java is faster than C++, Then I think it will have come at the expence at many of the things that java gets right.

    --
    Famous Last Words: "hmm...wikipedia says it's edible"
  4. Re:Now you're talking Profiling by Timothy+Brownawell · · Score: 0, Redundant
    Using Profiling as an optimization tool is *always* unfair unless both tools are provided with the advantage of the same profiling information. This is a valid question for the author then: if the JIT/javac/JVM uses profiling information, gcc should too, for fair comparison.
    Why? In neither case did the programmer do extra work to provide profile data. If one tool can figure that out for itself somehow, that's a valid advantage. Which tool works better with a given amount of programmer time?

    Tim