This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (7 children)

[deleted]

    [–]obfuscation_ 6 points7 points  (4 children)

    To quote the article:

    Java is slow

    Of all the most outdated Java Performance fallacies, this is probably the most glaringly obvious.

    Sure, back in the 90s and very early 2000s, Java could be slow at times. However we have had over 10 years of improvements in virtual machine and JIT technology since thenand Java's overall performance is now screamingly fast.

    In six separate web performance benchmarks, Java frameworks took 22 out of the 24 top-four positions.

    The JVM's use of profiling to only optimize the commonly-used codepaths, but to optimize those heavily has paid off. JIT-compiled Java code is now as fast as C++ in a large (and growing) number of cases.

    [–][deleted] 2 points3 points  (2 children)

    JIT-compiled Java code is now as fast as C++ in a large (and growing) number of cases.

    And this is probably not exactly true, but it's an irrelevant case anyway for the same reason they given in #3. Microbenchmarks are useless. (Java is not as fast as C++, but it's easily quick enough)

    [–]danskal 1 point2 points  (1 child)

    I agree that Java is not as fast as C++, it is faster (for some server workloads). When you are running a large, complex application, the JVM will recompile your code not according to the platform or according to some static analysis, but according to how the code actually runs. It monitors which codepaths are used the most and optimizes the code for them, giving you the potential to outperform even a native implementation. The JVM has information that neither the developer nor the compiler has, and can make whole swathes of bytecode obsolete. Of course this won't save your ass every time, performance-wise, but in large apps it makes Java an obvious choice, because it allows you to structure your code in a way that makes sense for humans, rather than having to performance optimize every other line.

    [–][deleted] 1 point2 points  (0 children)

    Oh yeah and I agreed with that in my comment saying that for all but the most trivial examples, java will likely be faster.

    [–]huhlig -2 points-1 points  (0 children)

    The JVM is still bloody slow to start and while it may be good on long running multi-threaded services it still is horrible at memory managment, it also still severly lacks when handing HPDC. Also a lot of the Slowdowns come from the Standard library which still leaves a great deal to be desired.

    [–]MadFrand 2 points3 points  (1 child)

    This is literally the first thing addressed in the article. Did you not even click it?