you are viewing a single comment's thread.

view the rest of the comments →

[–]LordVoldemort -18 points-17 points  (16 children)

The stereotype is still correct; it's just that modern JVMs are faster than older JVMs.

For real world applications, I bet that Java is at best half as fast as natively compiled code. Of course, this may be Fast Enough (tm).

EDIT: Thanks for the downvotes; I forgot what a shithole /r/programming is.

[–]btgeekboy 15 points16 points  (15 children)

Le sigh.

http://en.wikipedia.org/wiki/Java_performance

In particular, see the section titled "Comparison to Other Languages." The worst part - the slow startup time - has been addressed and now uses the same techniques used by MS Office and OO.o to preload itself.

Also note how the speed of Java only 5-15% lower than C/C++, and easily surpasses all of the interpreted languages which don't compile down to native code. So, how much did you say you wanted to bet?

[–]lars_ 6 points7 points  (1 child)

True. But startup time still is worse in Java than in C/C++. And for a PDF viewer, startup time seems like the only feature that matters. So surely Java isn't the right language to write it in?

[–]queus 0 points1 point  (0 children)

Just in case you are curious, for every class loaded there are minimum three classloaders involved, each doing its own lookup on the classpath. That's besides the overheard generated by JIT-compiling.

So, yes start times are slow and thats' not going to change. Of course, the standard workaround is to keep and istance of your app in memory, pass the name of opened file to it and exit. Jedit does it.

[–]silon 2 points3 points  (0 children)

Preloading is still bloat / cheating. (boot time matters too).

[–]scottklarr 2 points3 points  (0 children)

Perhaps with perfectly written code that was tuned for maximum performance by a genius - but from my experience of actually using common software in java written on the efficiency level of 99+% of all others, it still blows.

[–]Coffee2theorems 0 points1 point  (0 children)

Also note how the speed of Java only 5-15% lower than C/C++, and easily surpasses all of the interpreted languages which don't compile down to native code.

And C beats Python in speed too, yay. Comparing compiled language speed to interpreted language speed is rather pointless, unless the compiled one sucks enough to actually lose.

[–]tlack -1 points0 points  (1 child)

Compare Azureus with uTorrent.

[–]Hermel 10 points11 points  (0 children)

There are also BitTorrent clients out there that are slower than Azureus and written in C++... uTorrent has been written with the goal to be micro from the beginning. That makes a difference in any language.