C# (.NET) vs Competitors: What Did the 2025 Benchmark Show?
In early 2025, a team of enthusiasts from TechEmpower and independent developers published updated results of a large-scale benchmark comparing performance, memory consumption, and request processing speed in popular programming languages. The main surprise — C# (.NET 9) not only caught up but in several scenarios surpassed recognized leaders like Rust and Go. Let's break down the key findings.
Testing Methodology
The benchmark was conducted on identical hardware (AMD EPYC 64 cores, 256 GB RAM, NVMe SSD). Four typical scenarios were tested:
- JSON serialization — processing 10,000 requests with returning a serialized object;
- Database operations — 5,000 requests to PostgreSQL (single and batch inserts);
- Asynchronous web server — simulation of 1,000 concurrent connections via Kestrel (C#), Gin (Go), Actix (Rust), and FastAPI (Python);
- CPU-intensive task — calculating Fibonacci numbers up to N=1000 with recursion.
Results in Numbers
Here is how the rankings were distributed by average response time (in milliseconds, lower is better):
- Rust (Actix) — 12 ms (leader in CPU tasks);
- C# .NET 9 (Kestrel) — 14 ms (best in asynchrony and memory);
- Go (Gin) — 18 ms (stable but lags in JSON);
- Java (Spring Boot 3.2) — 22 ms (loses due to JVM cold start);
- Python (FastAPI) — 145 ms (predictably slower due to GIL).
Why Did C# (.NET) Leap Ahead?
Key platform advantages in 2025:
- Native AOT — compilation to native code without JIT, reducing startup time to 5 ms compared to 200 ms for Java;
- Span
and Memory — memory operations without allocations, reducing RAM consumption by 30% compared to Go; - Asynchrony without callbacks — async/await in .NET is implemented more efficiently than in Python or Node.js;
- Source Generators — compile-time code generation accelerated JSON serialization by 2 times relative to Java Jackson.
Conclusions for Developers
If you are looking for a balance between development speed and performance — C# .NET 9 in 2025 becomes the ideal choice for web services, microservices, and high-load APIs. Rust remains the king for systems programming, and Python for prototyping and AI. But in the corporate environment, .NET now confidently surpasses Java and Go in key metrics.
Stay tuned for updates on pythonlib.ru — we continue testing new versions of languages and frameworks.