6 ms·
We've seen several anecdotes where JIT languages (e.g. Java) outperform Rust in throughput and latency in long-running server programs.
by za3faran 6d ago
We've seen several anecdotes where JIT languages (e.g. Java) outperform Rust in throughput and latency in long-running server programs.
- apatheticonion 5d agoPerformance isn't really the selling point for me. It's the fact that runtime errors are essentially impossible, making writing, reviewing, testing code very easy. It also means LLMs can spin it out with the compiler, and if it compiles, it probably works. You just need to organize the code.
- throwaway273748 5d agoIt is mathematically impossible for a Java program to be faster than a well optimized Rust program, so long as the JVM exists and requires non-zero resources to run (to say nothing of GC etc). This isn't me glazing Rust, this is just the boring observation that a VM language is necessarily going to be outperformed by a language without a VM. VMs have good attributes, but they are never zero cost.
- za3faran 5d agoKey is "well optimized". At some point and scale, it becomes almost impossible to chase those manual optimizations, not to mention that usage patterns at runtime can change in such a way that make such an optimization prohibitively expensive, if not outright impossible. And even then, you would end up matching what the JVM JIT offers anyway. What I mentioned is already something that people have observed for both Rust and C++ against programs written in Java. Now add features like observability, profiling, debugging, and dev productivity, and it becomes a worthwile tradeoff a lot of the time. For constrained environments, GraalVM offers native image.
- deleted 5d ago[deleted]