4 ms·
Java programs are quite often 2x or more slower than they could be if written in C. See for example some simple benchmarks at http://julialang.org/ http://julia
by StefanKarpinski 11y ago
Java programs are quite often 2x or more slower than they could be if written in C. See for example some simple benchmarks at http://julialang.org/ http://julialang.org/ – Java ranges from 1x to 3.92x as slow as C. The billions of dollars that have been poured into JVM optimizations have closed the gap a lot, but by no means all the way.
- pjmlp 11y agoMy problem with these benchmarks is always which JVM are they measuring, given that I can choose any of these ones: https://en.wikipedia.org/wiki/List_of_Java_virtual_machines https://en.wikipedia.org/wiki/List_of_Java_virtual_machines It is like I would measure C performance by picking a specific compiler, even though I can choose any of these ones: https://en.wikipedia.org/wiki/List_of_compilers#C_compilers https://en.wikipedia.org/wiki/List_of_compilers#C_compilers
- nickpsecurity 11y agoDamn, you got me: I was cheating by using Azul's Zing on Vega 3 processors. http://www.azulsystems.com/products/vega/processor http://www.azulsystems.com/products/vega/processor Well, would be if I was a Java salesman. ;)
- nickpsecurity 11y agoStill doesn't call out parent's point because Java is a bad example for both of you. It's a behemoth compared to safer, systems languages with a history of performance problems. Original was something like 10-15x slower than C. A proper comparison would be to something like Component Pascal, Modula-2/3, Ada, Fortran for numeric algorithms, and so on. Their results were high performance with higher correctness and predictable behavior. So, parent's point stands and so does mine that only C's bad design and culture lead to relying on undefined behavior for performance. They could just as easily optimize from well-defined semantics into assembly like the other languages mostly did.