Return to site

#Top #programming #languages #performer

· programmmer,java

1/ C
2/ Rust
3/ Java

Who is saying Java is slow? People stuck in the 90s.

🐌 Why it seemed slow back then
- Interpreter-only (Java 1.0/1.1): Bytecode ran without JIT, so CPU-bound code lagged behind C/C++.
- Weak hardware + dial-up: Applets/classes loaded over the network; startup and UI (AWT) felt sluggish.
- Early GC & threading: Early garbage collectors and “green threads” added pauses and overhead.
- Cold start: Even later, apps were “slow until warm” because the JIT needed time to optimize.

🐯 What changed (and why Java is fast now)
- HotSpot JIT (late ’90s →): Adaptive optimization, inline caching, escape analysis, tiered compilation.
- Modern GCs: G1, ZGC, Shenandoah → low pauses and predictable latency.
- Class Data Sharing (CDS) & AppCDS: Faster startup, lower memory.
- Graal JIT & Native Image: Higher peak performance; optional AOT for tiny startup times.
- JVM ergonomics: The VM tunes itself to your machine; long-running services reach C/C++-like throughput.

✨ Where Java shines today
- Server/back-end workloads: After warm-up, throughput and latency are competitive.
- Large-scale systems: Mature GC/JIT + tooling (profilers, observability) = reliability and speed.
- Option to go native: GraalVM Native Image for sub-second startup and small RSS when that’s the priority.

💡 TL;DR: Early Java had real performance issues (mostly startup/JIT-less era), but modern Java is highly optimized and absolutely not “slow” for the kinds of workloads it targets.