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.""

29 of 1,270 comments (clear)

  1. Yes but... by Anonymous Coward · · Score: 2, Funny

    how does it corner?

  2. Netcraft Confirms: by BandwidthHog · · Score: 3, Funny

    Fact: C++ is dying....

    Oh hell, I don't have the heart. Nevermind.

    --

    Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
  3. Anyone got a match? by nebaz · · Score: 5, Funny

    Here's some kindling...

    vi is better than emacs
    bsd is better than linux
    gnome is better than kde
    .
    .
    .
    anything else?

    oh yeah...
    my dad can beat up your dad.
    And you smell funny.

    --
    Rhymes that keep their secrets will unfold behind the clouds.There upon the rainbow is the answer to a neverending story
  4. meh by jnapalm · · Score: 2, Funny

    i tried to get first post with my C++ autoposting application...but its too damn slow.

  5. Re:my arse by kaffiene · · Score: 3, Funny

    "My arse" is a good name for this post since that's obviously where your head is stuck - much like the rest of the /. morons with their anti-java-no-matter-what stance.

    I used to be a C hacker and a laughed at Java when it came out because of it's poor performance. Times have changed, but the language bigots haven't.

  6. Re:Sorry, no. by Ianoo · · Score: 4, Funny

    I think you're missing the point. I bet 19 seconds of that execution time was the start-up and shutdown of the virtual machine. As the program gets bigger and bigger, this becomes less and less significant.

  7. Some problems I had using Java by Anonymous Coward · · Score: 2, Funny

    I don't want to start a holy war here, but what is the deal with you Java fanatics? I've been sitting here at my freelance gig in front of a Java program (running on a PIII 800 w/512 Megs of RAM) for about 20 minutes now while it attempts to copy a 17 Meg file from one folder on the hard drive to another folder. 20 minutes. At home, running an equivalent Visual Basic program on my Pentium Pro 200 with NT 4, which by all standards should be a lot slower than this Java program, the same operation would take about 2 minutes. If that. In addition, while it is running, Netscape will not work. And everything else has ground to a halt. Even jEdit Lite is straining to keep up as I type this.

    I won't bore you with the laundry list of other problems that I've encountered while working on various Java programs, but suffice it to say there have been many, not the least of which is I've never seen a Java program that has run faster than its VB counterpart, despite Java's faster runtime system. My 486/66 with 8 megs of ram runs VB programs faster than this 800 mhz machine runs Java at times. From a productivity standpoint, I don't get how people can claim that Java is a "superior" language.

    Java addicts, flame me if you'd like, but I'd rather hear some intelligent reasons why anyone would choose to use a Java over other faster, cheaper, more stable systems.

    1. Re:Some problems I had using Java by ky11x · · Score: 2, Funny

      You, sir, are inspired. I applaud this wonderful transformation of the Mac troll into a Java troll. I'm sitting over here laughing so hard my nose hurts.

  8. Re:every year this happens... by Sebastopol · · Score: 2, Funny

    "It's always been written in Java."

    Except for the first Java compiler. ;P

    --
    https://www.accountkiller.com/removal-requested
  9. Re:This doesn't make any sense... by Omnifarious · · Score: 1, Funny

    I actually find Java significantly more painful to develop in because it takes such a huge amount of time to start up the JVM that a debugging session is an exercise in fetching coffee. The class libraries are also poorly designed, and the language is excessively verbose.

  10. Re:He used g++ to compare C++ with Java... by crawdaddy · · Score: 2, Funny

    You really see a difference in the infinite-element circuit simulators, though. That's probably what he's referring to.

  11. Re:Caught up with the speed, but still the ugliest by kaffiene · · Score: 3, Funny

    For years it was "Java is too slow" Now it's too ugly??

    Sheesh.

    I'm sure one of Swing (with it's several different look and feels and skinnable interface) or SWT or AWT will fit the bill.

  12. I Smell funny? by Bill,+Shooter+of+Bul · · Score: 2, Funny

    Well, you'd better tell your mom to switch perfumes.

    --
    Well.. maybe. Or Maybe not. But Definitely not sort of.
  13. One more... by Rufus88 · · Score: 5, Funny


    anything else?

    Yeah, Kuro5hin is better than Slashdot.

  14. Re:Languages vs Compilers by ms139us · · Score: 2, Funny

    Languages aren't "faster" or "slower"

    Thank God, finally someone understands! I was recently benchmarking Turtle Logo against some highly optimized Opteron-specific assembly code for an application that calculates PI to the 400,000th digit.

    I was surprised to see that Logo was slower, but I think I just didn't optimize it enough. I am tuning the Logo floating point code right now, and Logo should stomp the hell out of the assembly code "Real Soon Now."

  15. Re:The Great Computer Language Shootout by Anonymous Coward · · Score: 1, Funny

    as we are computernerds we can write a plugin that adds a "use no referer" option to the context menu for links, or we can simply copy paste links...

  16. Re:Um, it's online by kin_korn_karn · · Score: 2, Funny

    Yes sir, Professor Knuth.

  17. Re:Sorry, no. by phasm42 · · Score: 4, Funny

    I just wrote two programs to count to 1 billion. The one written in C took 2.4 seconds, the one written in assembly took 0.85 seconds. Wow, assembly is so much faster. My in-depth analysis of these two languages has shown once and for all that all us high-level language suckers need to get back to coding in assembly and quit this HLL foolishness.

    --
    "No one likes working in a hamster wheel, and your shop smells of cedar shavings from here." - TaleSpinner
  18. Java Faster Than C++? by Dun+Malg · · Score: 2, Funny
    "Java Faster Than C++?"

    (/me runs screaming from soon-to-be-burning building)

    Is there something about flame-conducive subjects that make people want to "pick the scab", so to speak, or is it that sensitive subjects make people want to set stuff on fire? I think the Java vs. C++ holy wqar has even surpassed the EMACS vs vi one. (This is a good thing, I think, because arguing over vi vs. EMACS is a waste of time when it's clear that EMACS is better)

    --
    If a job's not worth doing, it's not worth doing right.
  19. Re:Um, it's online by dnoyeb · · Score: 2, Funny

    It does not matter. As I have said each time this stupid question comes up the whole thing is moot.

    Java VMs are written in C++ among other languages. This issue is just plain silly.

  20. Re:Nice to hear... by drew · · Score: 3, Funny

    I think about the PHP/PostgreSQL applications I write today and shudder when I imagine what how difficult it would be to have to develop web applications in Java...

    --
    If I don't put anything here, will anyone recognize me anymore?
  21. Re:Expert results by drew · · Score: 2, Funny

    you didn't even have to go that far to see his bias... just take a look at the title:

    The Java is Faster than C++ and C++ Sucks Unbiased Benchmark

    --
    If I don't put anything here, will anyone recognize me anymore?
  22. Obligatory Bash Quote... by MP3Chuck · · Score: 3, Funny

    http://bash.org/?338364 #338364 +(1308)- [X] Saying that Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders

  23. Re:Can I have an infinite budget to write the code by Bryan_W · · Score: 2, Funny

    Why not just use VB? It would have been the easiest and probably faster.

  24. Re:Um, it's online by javax · · Score: 2, Funny

    bah, its obvious that Java is Turing complete, so you can do everything with it.

  25. However, C++ is faster to LEARN than java by RLiegh · · Score: 2, Funny

    at least if you already know C.

  26. Re:My Hero! by kfhickel · · Score: 2, Funny

    That's right, assembly isn't all that!

    learn microcode, then come and talk to me!!!!

    (yeah, I'm old, so what!) ;>

  27. Re:Sorry, no. by maxwell+demon · · Score: 2, Funny

    Well, actually, an ideal optimizer would detect that this loop has no observable behaviour, and therefore optimize it away completely. That is, the complete loop would be compiled to zero instructions and executed in zero time. Of course, a perfect Java compiler could do the same, which of course gives the question of how many times faster Java zero time is to C++ zero time :-)

    --
    The Tao of math: The numbers you can count are not the real numbers.
  28. FAIL YOUR STUDENT by EventHorizon · · Score: 2, Funny

    And tell him to check for buffer overruns next time (num > max).

    On the plus side: after he flunks out, he can go write RPC code at Microsoft.

    Or, perhaps, a cell phone bluetooth stack.

    [Ducks And Covers]