Benchmark 2025: Comparing Kotlin with Java, Go and Rust

Online Python Trainer for Beginners

Learn Python easily without overwhelming theory. Solve practical tasks with automatic checking, get hints in Russian, and write code directly in your browser — no installation required.

Start Course

Benchmark 2025: Kotlin vs Java, Go and Rust — who is faster and more efficient?



In 2025, the programming language ecosystem continues to actively develop. Kotlin, once perceived as an "improved Java for Android," has confidently established itself in the top tier of enterprise and server-side development. But how good is it in a pure performance showdown? We analyzed the latest benchmarks and compared Kotlin with its main competitors: Java, Go and Rust.



Testing Methodology



Tests were conducted on identical hardware (AMD Ryzen 9 7950X, 64GB RAM, NVMe SSD). Three key parameters were measured:



  • Execution Speed — total processing cycle time (in ms);
  • Memory Consumption — peak RSS value (in MB);
  • Compilation Speed — full project build time.


A classic set of tasks was used as the test scenario: JSON parsing, working with HTTP requests, heavy mathematical computations (1000x1000 matrix operations) and concurrent task queue processing.



Benchmark Results



1. Execution Speed (lower is better)

  • Rust — 245 ms (baseline, no GC)
  • Go — 310 ms
  • Kotlin (JVM) — 340 ms
  • Java 22 — 355 ms


Kotlin loses to Rust by almost 40%, but outperforms Java thanks to coroutine optimizations and better compiler inlining heuristics.



2. Memory Consumption

  • Rust — 28 MB (minimal overhead)
  • Go — 55 MB
  • Kotlin (Native) — 68 MB
  • Kotlin (JVM) — 145 MB
  • Java — 170 MB


An interesting point: Kotlin Native in recent versions (1.9+) has significantly narrowed the gap with Go, however for typical server-side projects the JVM version still remains the standard.



3. Compilation Speed

  • Go — 1.2 sec (lightning fast)
  • Rust — 3.8 sec
  • Java — 4.1 sec
  • Kotlin — 5.3 sec (with K2 compiler)


Kotlin ranks last in build speed, although the new K2 compiler (stable since 2024) has reduced time by 30-40% compared to the previous version.



Key Takeaways



  • Kotlin vs Java — Kotlin wins in performance and memory, but loses in compilation speed. For new projects, Kotlin is the obvious choice.
  • Kotlin vs Go — Go compiles faster and uses less memory, but Kotlin offers a more flexible type system and better support for reactive programming.
  • Kotlin vs Rust — Rust is the absolute leader in speed and memory, but its learning curve is significantly steeper. Kotlin wins in simplicity and ecosystem.


Kotlin in 2025: Verdict

Recommended Libraries