3 ms·
The claim that performance are comparable only on "toy benchmarks" is false. Additionally, most of such simple benchmarks are not representative for real-life w
by goodpoint 4y ago
The 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..