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

21 of 1,270 comments (clear)

  1. my arse by Anonymous Coward · · Score: -1, Troll

    Ha, and im richer than bill gates

    1. Re:my arse by Anonymous Coward · · Score: -1, Troll

      Java is gay

  2. c# is faster!!! by Anonymous Coward · · Score: -1, Troll

    c# is faster than java, so is c# faster than c++?

    1. Re:c# is faster!!! by Anonymous Coward · · Score: -1, Troll

      NO WAY. The convicted monopolist could never create something better than java. And once java goes open source, get ready for it to kick the convicted monopolist's ass! Java is the future, and C# are for money hungry assholes.

  3. FP! by Anonymous Coward · · Score: -1, Troll

    Not on my PC it ain't!

  4. My C++OCK can find pussy faster by Anonymous Coward · · Score: -1, Troll

    I did comparision testing between my C++OCK and a Java drinking jock. My C++OCK won balls down.

    Props to Penus Torvalds!!

  5. I call shenanigans by Anonymous Coward · · Score: -1, Troll

    I'm sorry but there's just no way.

  6. Java may be fast but ... by Anonymous Coward · · Score: 0, Troll

    ... C++ is more portable.

  7. Java sucks, pass it on by mrshowtime · · Score: -1, Troll

    Yah, "present day" Java may be the bee's knees, but I cannot forgive it for it's slow-loading-lock-lock-up-my-computer- past.

    --
    "Jeremy, you need to get to an internet cafe and cut and paste some appropriate sentiments about me from the world wide
  8. Developers: World Flat, Sky Green by random+coward · · Score: 0, Troll

    And Microsoft is more stable than Linux.

  9. Nort really surprising by Anonymous Coward · · Score: 0, Troll

    Just see what comes out of profiling this:

    int main( int argc, char **argv )
    {
    for ( int ii = 0; ii < 10240; ii++ {
    cout << ii << endl;
    }
    return( 0 );
    }

    Now compare it to this:

    int main( int argc, char **argv )
    {
    char s[ 2 ];
    s[ 1 ] = '\n';
    for ( int ii = 0; ii < 10240; ii++ {
    s[ 0 ] = '0' + ( char ) ii;
    write( 1, s, 2 );
    }
    return( 0 );
    }

    Guess which one's going to be several orders of magnitude faster?

  10. This doesn't make any sense... by 3)+profit!!! · · Score: -1, Troll

    How can emulation (running Java in a virtual machine) be any faster than running a native executable?

  11. Java is dying by Anonymous Coward · · Score: -1, Troll

    It is official; Yahoo confirms: Java is dying

    One more crippling bombshell hit the already beleaguered Java community when IDC confirmed that Java market share has dropped yet again, now down to less than a fraction of 1 percent of all programming language use. Coming on the heels of a recent Yahoo report which plainly states that Java has lost more market share, this news serves to reinforce what we've known all along. Java is collapsing in complete disarray, as fittingly exemplified by failing dead last in the recent Sys Admin comprehensive networking test.

    You don't need to be a Kreskin to predict Java's future. The hand writing is on the wall: Java faces a bleak future. In fact there won't be any future at all for Java because Java is dying. Things are looking very bad for Java. As many of us are already aware, Java continues to lose market share. Red ink flows like a river of blood.

    Let's keep to the facts and look at the numbers.

    Sun leader Scott McNealy states that there are 7000 users of J2EE. How many users of J2ME are there? Let's see. The number of J2EE versus J2ME posts on Usenet is roughly in ratio of 5 to 1. Therefore there are about 7000/5 = 1400 J2ME users. GCJ posts on Usenet are about half of the volume of J2ME posts. Therefore there are about 700 users of GCJ. A recent article put J2SE at about 80 percent of the Java market. Therefore there are (7000+1400+700)*4 = 36400 J2SE users. This is consistent with the number of J2SE usenet posts.

    Due to the troubles of Java, abysmal sales and so on, Sun went out of business and will probably be taken over by IBM who sell another troubled programming language. Now IBM is also dead, its corpse turned over to yet another charnel house.

    All major surveys show that Java has steadily declined in market share. Java is very sick and its long term survival prospects are very dim. If Java is to survive at all it will be among programming dilettante dabblers. Java continues to decay. Nothing short of a miracle could save it at this point in time. For all practical purposes, Java is dead.

    Fact: Java is dying

  12. That's what happens with the lowest common GUI by Anonymous Coward · · Score: -1, Troll
    Swing has to be able to work with X Windows, Apple, and Microsoft.

    So it's stuck with the lowest common elements of all the operating systems it can run on.

  13. Java is still pants... by Skiron · · Score: 0, Troll

    ... and always will be.

    Give me ONE good reason what java actually does right?

    You need one hell of a machine to run all the crap. It is still not fault tolerant to any degree.

    And seeing as it was initialy designed to run video recorders and washing machines, et al, why doesn't it now?

    Nick

  14. Thanks. Article is a troll. by twitter · · Score: -1, Troll
    I was actually dumb enough to click that and get to see the obnoxious Slash hole page again.

    The article must have been a troll. It recommends non-free software. It's counter intuitive and contrary to most people's experience and therefore technically dubious. That's rich, given the inflammatory page it points to complains that you can't trust Slashdot for technical content. The whole thing looks like a set up to make Slashdot look as bad as possible. Doug should know better and is therefore suspect.

    Doug should be complaining about his TOS rather than the "Slashdot effect". Attention is what you get when you post material of technical merit onto the web. The "Slashdot Effect" is just another one of those facts of life we all have to live with, like hurricanes. TOS that don't deal with that possibility are screwing Doug, not Slashdot. This is one of those things that ISPs need to deal with. Every two bit data center on earth has spent hundreds of thousands of dollars on off electric generating equipment, HVAC, and physical security. Responsible ISPs don't slap their users because other people launch a DoS attack on them. Yes, 99% of the dreaded Slashdot attack is a DoS attack generated by people who don't like Slashdot. I doubt that escaped Doug's notice.

    The quit slashdot site is flame bait hardly worthy of a reply. Slashdot does cull it's stories well and there is usefull information to be had reading the blurbs. Yes, the comments have been run over by determined and well organized trolls. It's been more than a year since I've been given mod points. I could care less. I have fun here anyway and the exercise keeps my writing skills sharp. Yep, my GRE verbal and writing sample were top decile. This is not a service I get from passive news feeds by supposed "experts" and industry shills that generally follow Slashdot by a week or more. Eat me trolls. Am I rabid and foaming at the mouth over it? Hell no. I could care less about insults delivered by people I don't know and I get to shout it all out here.

    Twitter is laughing all the way to his next 16 ounce curl at this latest nasty attack on his favorite news service.

    --

    Friends don't help friends install M$ junk.

  15. I don't know about Java, but... by callipygian-showsyst · · Score: 1, Troll
    I refuse to run Java for political reasons (I don't care to support pedophilia), but I recently starting doing a lot of work in Microsoft's C#, which is similar in it's implementation.

    Like Java, C# is compiled to an intermediate code for a "virtual machine" that is typically JIT compiled for the target processor. I've been amazed at the speed. I'm doing graphics applications where I'm moving bits around manually, and C# is plenty fast! And it's nice to have garbage collection and modern features.

    C# also has some other advantages over Java: it's a standard language (it has been submitted to the ECMA standardization committee), and has advanced features like "generic types" (similar to templates), pointers, and good XML serialization support.

  16. Ah, C++ ... by Crispin+Cowan · · Score: 0, Troll
    C++ has the safety of C, and the performance of SmallTalk :(

    There is no excuse for writing anything in C++ in this day and age:

    • If you are writing a kernel or an embedded bit whacker or a real-time thing, use C. C++ is too slow.
    • If you are writing an application, be it desktop, server, whatever, use Java or C#. C++ is far too unsafe.
    • If you are writing a rapid prototype, use PERL, or Python, or Ruby.
    My condolances to the KDE kommunity. It's a cool desktop & all (I'm typing on it) but bolting your whole framework on a C++ basis was a really unfortunate choice. It dooms KDE to long-term security vulnerabilities.

    Crispin
    ----
    Crispin Cowan, Ph.D.
    CTO, Immunix Inc.

  17. *sigh* by ldspartan · · Score: 1, Troll

    So, I'm done with my CS degree from RPI, and I'd like to point out we're not all morons like this kid apparently is. Also remember he's just finished his sophomore year, and has probably just taken basic classes like Data Structures and Algorithms and Operating Systems.

    It just cheapens my degree, sadly.

    --
    lds

  18. Re:My Hero! by Anonymous Coward · · Score: -1, Troll

    oh so you.. "know assembly", and have "studied CPU designs", and also "know compiler technology".. yes, those vagueries really sound completely valid.. I could probably scratch together a few programs on 5 architectures off of the top of my head, and if I was to believe that you have any fucking clue what you're talking, that would make me almost as fucking braindead as you clearly are.. good god, is everyone on this website just full of shit or what

  19. Re:Caught up with the speed, but still the ugliest by Anonymous Coward · · Score: -1, Troll

    spoken like an arrogant, wortheless code-monkey