2 ms·
I can't speak to the others, but Java & Kotlin do not at all have C++-like performance, especially not in anything beyond a toy level benchmark. And even in th
by kllrnohj 4y ago
I can't speak to the others, but Java & Kotlin do not at all have C++-like performance, especially not in anything beyond a toy level benchmark.
And even in those toy level benchmarks (like https://benchmarksgame-team.pages.debian.net/benchmarksgame/box-plot-summary-charts.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... ), there's a clear divide between C/C++/Rust & everything else.
- goodpoint 4y agoThe claim that performance are comparable only on "toy benchmarks" is false. Additionally, most of such simple benchmarks are not representative for real-life workload, and anyways the initial point was about safety. Anyhow the whole HN conversation is now a trainwreck where any dissenting opinion is downvoted so there's no point to continue.
- pkolaczk 4y agoToy benchmarks give JVM an edge because JVM optimizes code locally. Small amount of code in a benchmark means a majority of it can be inlined and then the JVM can actually remove a lot of Java-specific overhead like heap allocations, at least theoretically (I've seen it utterly fail in some cases even on toy benchmarks, though). However in bigger programs JVM has no way to optimize the inherent overheads stemming from the design of the Java language. Rust and C++ don't have those overheads from the start, and then on top of that their compilers can do whole program optimization because they have plenty of time and resources to do so.
- kllrnohj 4y agoToy benchmarks are also a lot easier to write in "C-like" Java instead of "normal" Java. That is, avoiding boxing, interfaces, etc..