r/programming • • Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35 Upvotes

636 comments sorted by

View all comments

Show parent comments

5

u/bcash Feb 22 '15

except for a few unlikely scenarios where the JIT works perfectly

This isn't even a strawman. JIT will never "work perfectly", and it doesn't have to. This is very much a case of 50% of the effort delivering 90% of the benefit; most cases are "good enough" rather than all-but one being bad.

It's also wrong to call what Java does JIT. Compilation occurs during run-time, the same piece of code can and will be recompiled multiple times as it's running.

All this means that Java's performance is non-deterministic, which is a showstopper for a lot of applications, but not all. Being non-deterministic doesn't mean "bad", the average, and even 90th percentile I'd say, case is still very good.

Good enough that the difference between C and Java is within an order of magnitude in "real-world" cases.

Java's memory usage, however, will be much higher.

1

u/Dragdu Feb 22 '15

So, where are the Java based linear algebra libraries? Yes, this is very much tongue in cheek, but it is important to remember, that there are many kinds of "real world cases".

4

u/Radmonger Feb 22 '15

https://code.google.com/p/efficient-java-matrix-library/

provides links to all the ones it is faster than, and also some sparse matrix libraries that beat it in appropriate cases.

Java is actually a pretty good match for that kind of thing, as unlike quite a few languages it does provide true primitive arrays, and any per-object overhead goes away when everything is 10,000x10,000.

1

u/Dragdu Feb 22 '15

Ah yes, relative speed benchmarks of Java libraries. For when the actual numbers don't paint a good picture.

Where is comparison to MKL and other state of the art libraries?

→ More replies (1)