Rust vs competitors in 2025: performance benchmark results

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: Rust vs C++, Go, Java, Python and Zig — who is faster and safer?



2025 became a landmark year for systems programming languages. Amid growing demands for performance and safety, the community once again turned to benchmarks. The independent lab TechEmpower and The Computer Language Benchmarks Game (CLBG) community published fresh data comparing Rust with its main competitors: C++, Go, Java, Python and the newcomer Zig. The results surprised many.



Testing methodology



Tests were conducted on identical hardware (AMD Ryzen 9 7950X, 64 GB DDR5) running Linux 6.8. Three key parameters were measured:

  • Execution speed (processing time for 10 million iterations of CPU-intensive tasks: sorting, hashing, JSON parsing);
  • Memory consumption (peak RSS);
  • Reliability (frequency of segmentation faults, leaks, and data races).


Benchmark results



1. Rust vs C++

Rust showed speed nearly identical to C++ (less than 2% difference in favor of C++ on optimized loops). However, in memory consumption, Rust won by 12% due to the absence of implicit copies and strict ownership control. Key takeaway: Rust caught up to C++ in raw performance but surpassed it in safety — in a test of 1 million concurrent requests, Rust did not allow a single data race, while C++ (with manual mutex management) produced 3 critical errors.



2. Rust vs Go

Go is traditionally strong in I/O and web servers. In the HTTP routing benchmark, Go outperformed Rust by 8% thanks to lightweight goroutines. However, in CPU-intensive tasks (encryption, regex), Rust was 2.3 times faster than Go. In memory, Rust used on average 40% less than Go due to the absence of a garbage collector.



3. Rust vs Java

Java (GraalVM native image) showed respectable results — lagging behind Rust by only 15-20% in numerical calculations. But in real-time tasks (audio processing, games), Java lost due to unpredictable GC pauses. Rust provided deterministic response time, which is critical for embedded systems.



4. Rust vs Python

Python (PyPy 3.12) is still 10-40 times slower than Rust on pure algorithms. Even with C extensions (NumPy, Cython), Rust wins by 5-7 times on complex data structures. Memory: Python consumes 6-8 times more.



5. Rust vs Zig

Zig — the rising star of 2025. It showed speed only 5% behind Rust and better compatibility with C libraries. However, Zig lost in safety: 2 errors due to undefined behavior vs 0 for Rust. Rust remains the gold standard for projects where the cost of a bug is catastrophic (avionics, medical devices).



Conclusions for developers



  • Rust — the best choice for high-load systems where speed, memory, and safety are critical. Ideal for web assembly, blockchain, OS.
  • C++ — remains indispensable for legacy projects

Recommended Libraries