• Woohoo (unregistered) in reply to Anon
    Anon:
    brazzy:
    I just tried the Quicksort.

    C++ version compiled with Borland C++ 5.5: bash-3.00$ QSort 10000000 startup time: 0.578 sort time: 2.297

    Java version run on JDK 1.6.0_04: bash-3.00$ java -server QSort 10000000 startup time: 0.219 sort time: 1.86

    I'm curious.

    What optimization settings where used for the C++ version? Where debug libraries used?

    And, the biggest one, if you're using bash, why not use the time command to get the program times? Why let the program report the time?

    My guess is because Java's true startup time and library load time would bloat the faked test time to make it lose to a C++ program.

    Plus you have to do some form of cheating to be able to skip the penalty of JIT compilation. Otherwise there's no way interpreted code would be as fast as native code.

    Yes there is. If the JIT pre-compiles code it does so by using the capabilities of the concrete underlying CPU/hardware platform, which is frequently much faster than the "common denominator" code used in pre-compiled programs.

    Of course in this concrete example this could be optimized for C++ too (this also depends on the compiler used), but I'm mainly talking about pre-built programs e.g. for Windows.

    The fact aside that there is a "startup time" value, reporting the time with JVM startup time (via bash's time command) would be plain dumb, because this defeats the purpose of comparing the speed of the algorithm. Moreover, the startup time is pathological when the total runtime is only a few seconds and would distort the result in favour of the native program. In real life the startup time accounts only for a tiny fraction of the whole lifetime - this is even more true on long-running server systems.

  • (cs) in reply to Anon
    Anon:
    What optimization settings where used for the C++ version? Where debug libraries used?
    I used the default settings for the C++ compiler because I'm not very familiar with C++ compilers, it was late at night and I couldn't be bothered, and I didn't want to take all the optimization fun away from the C++ guys. Why don't you try it yourself?
    Anon:
    And, the biggest one, if you're using bash, why not use the time command to get the program times? Why let the program report the time?

    My guess is because Java's true startup time and library load time would bloat the faked test time to make it lose to a C++ program.

    Plus you have to do some form of cheating to be able to skip the penalty of JIT compilation. Otherwise there's no way interpreted code would be as fast as native code.

    The disadvantages of Java in regard to startup times were already discussed and admitted. But fine, let's do that:

    bash-3.00$ time QSort 10000000 startup time: 0.562 sort time: 2.172

    real 0m2.813s user 0m0.015s sys 0m0.031s bash-3.00$ time java -server QSort 10000000 startup time: 0.203 sort time: 1.828

    real 0m2.317s user 0m0.031s sys 0m0.015s

    No way, eh?

    BTW, I propose that we move this to the forums to keep it in one place if we're going to go through more iterations.

  • mabinogi (unregistered) in reply to Anon
    Anon:
    Sadly, no. Most new non-Apple, non-Verizon cellphones contain a useless J2ME implementation, which you do pay Sun for.

    So just like people complain about the "Microsoft tax" when buying new PCs, new cellphones get dinged the "Sun tax" to allow you to run crappy mini-Java applications that no one in their right mind would ever use.

    Imagine the speed of a Java desktop application, shrunk down and running on a cellphone...

    Actually, java makes my phone useful. I use the gmail app, google maps, a java ssh client and Opera Mini - which is much faster than the crappy built in browser, and is a much better browser too.

  • AnotherAnon (unregistered) in reply to Anon
    Anon:
    You're right, I shouldn't expect 1GB of memory on a Core 2 Duo machine to be able to run Eclipse at a satisfactory speed. I suppose I should upgrade to a Core 2 Quad with 8GB of RAM to use an IDE.

    Exactly, and don't attemt to keep the company-wide mandated "Synchronous Temporal" chat client, which happens to also be Eclipse-based in its latest version, running at the same time, despite the name rhyme. Remember, the time you have to live with your underpowered laptop, from the time before the laptop brand was sold off to the asian company already producing it, has been extended. Not to mention the eSnot mail client and application platform that easily spends 90% CPU on doing neither task well.

    -Another Anon

  • biblicalskoler (unregistered) in reply to NeoMojo
    NeoMojo:
    Jimjim:
    Kind-hearted... It's a useful social skill to learn !
    Kind hearted? On this website? This is a site created explicitly to deride others. Looking for a kind heart here is like looking for an honest politician.
    Andrew:
    What kind of a fool would spend that much? Jesus.
    Interesting. What did he spend it on?

    some amazing public relations people.

  • Dirk (unregistered) in reply to yEAH rIGHT

    You're not joking about the steakhouse! WTF?

  • Dirk (unregistered) in reply to Volmarias
    Volmarias:
    esse:
    I though the "Java is SLOW" went out of fashion back in 2000?

    Bad troll, keep up.

    Exactly. Any poorly coded app can be slow, not just java apps. The idea of running j2me on your mobile phone is so that developers can write programs that will run on more than just one phone, theoretically withou a significant overhead of customizing their code for each single cellphone out there (and there are quite a few out there). But, please, continue telling us how SLOW java is and how our phones are INFESTED with java, especially when most of the slowness in phones comes from provider-specific firmware instead of using factory firmware (for example, my T-Mobile RAZR takes longer to access my contacts than my 8 year old Nokia shitbox did, despite not changing the number of contacts).

    So you've just admitted to the world that you haven't met anyone new for eight years??? Get out of your garage man!

  • titrat (unregistered)

    They should have spent 39 Mio on advertising an 1 Mio on the rest (sw/hw) - that could have worked.

  • Jobsworth (unregistered) in reply to Anonymous
    Anonymous:
    Wait - so the real WTF that the bank actually did a cost/benefit calculation and pulled emergency stop BEFORE spending the biggest part of the money?
    For a bank - yeah, that's a real WTF.
  • Jobsworth (unregistered) in reply to El_Heffe
    El_Heffe:
    management canceled the entire project, sending nearly a floor of developers to the curb

    A "floor" of developers? Is that a new unit of measurement? How many developers in a floor?

    I'm not sure, but I guess the density of a floor should be measured in cubicles per square smoot.

    Captcha: luctus. Sounds like Parry Hotter magic.

  • FIA (unregistered) in reply to ThatGuy

    If you're having trouble with firefox paging when minimized, then you might want to set the config.trim_on_minimize option to 'false'. This used to be 'true' by default although I think this has been changed now.

    Trimming the working set when minimized is a bit of a windows 3.1 hangover and not really needed anymore.

  • Martin (unregistered) in reply to sf

    The REAL reason that eclipse freezes is normally problems with a plugin or conflicts among plugins. Most likely cause for me is the the mylar plugin, but it might also be one of the build in plugins.

    The freezes are not caused by insane cpu usage, because when the occur, the cpu usage always drop to almost nothing(less then 4%) (Yes I have a cpu usage monitor visible at all times)

    If you start eclipse from a console(bash/cmd) you will see that when the freeze stops, eclipse will throw an exception.

    So you can see the freezes either as a good thing(Eclipse detected a problem, most likely a deadlock, and resolved it without crashing) or a bad thing(Plugins should not be ablo to freeze the gui). (Oh, and this is the same problem that firefox have with it's plugin).

  • dave (unregistered) in reply to gabba

    Sun's x86 servers are nice though!

  • Dean Pullen (unregistered)

    Hm this seems sneakily like what's written in the Boo Hoo biography of dot com failing boo.com

  • Crikey (unregistered) in reply to gabba

    Ha hA HA ha Ha jAvA BAd HAhAHahaHa

Leave a comment on “Out of Balance”

Log In or post as a guest

Replying to comment #:

« Return to Article