Benchmark 2025: Rust vs C++, Go and Python — who rules the roost?
2025 has become a turning point for systems programming languages. Rust, which was still recently perceived as a "fashionable newcomer," has confidently carved out a niche not only in infrastructure development but also in high-load web services, CLI utilities, and embedded systems. We conducted a series of benchmarks, comparing Rust with its main competitors: C++, Go, and Python. The results turned out to be unexpected even for experienced developers.
Testing methodology
The tests were conducted on identical hardware (AMD Ryzen 9 7950X, 64 GB DDR5, NVMe SSD). For each language, current compilers and runtimes were used:
- Rust — rustc 1.80.0, optimization flags
-C opt-level=3 - C++ — Clang 18, flags
-O3 -march=native - Go — Go 1.23, build without debug symbols
- Python — CPython 3.13, PyPy 7.3 (for comparison)
Three key metrics were measured: execution speed (time, ms), memory consumption (RSS, MB), and throughput (requests/sec for the web server).
Test results
1. Computational tasks (Fibonacci numbers, sorting, cryptography)
- Rust: 12.3 ms, 2.1 MB
- C++: 11.8 ms, 2.3 MB
- Go: 19.7 ms, 4.8 MB
- Python (PyPy): 145.2 ms, 38.1 MB
- Python (CPython): 820.4 ms, 42.5 MB
Conclusion: Rust has practically caught up with C++ in raw performance (less than 5% behind), while using 10% less memory. Go is 1.6 times slower, and Python is 11-66 times slower.
2. Web server (HTTP/1.1, 10,000 connections, JSON response)
- Rust (Actix-web): 215,000 req/s, 14.2 MB
- Go (net/http): 178,000 req/s, 19.8 MB
- C++ (Crow): 209,000 req/s, 15.1 MB
- Python (FastAPI + uvicorn): 28,000 req/s, 52.3 MB
Conclusion: Rust is not just faster than Go — it is 20% more efficient in throughput and 30% more economical in memory. C++ with Crow runs almost neck and neck with Rust.
3. File system operations (reading 1 million lines from CSV)
- Rust: 0.87 sec, 5.3 MB
- C++: 0.91 sec, 5.8 MB
- Go: 1.42 sec, 9.1 MB
- Python (pandas): 4.21 sec, 127 MB
Conclusion: In I/O tasks, Rust is minimally behind C++, but significantly ahead of Go and Python.