C# (.NET) vs Competitors: 2025 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

C# (.NET) vs Competitors: 2025 Benchmark Results



In early 2025, the independent developer community TechEmpower and the .NET Foundation team published updated performance benchmark results for popular languages and frameworks. The .NET ecosystem traditionally holds leading positions in web API and high-load service tasks. In this article, we analyze how C# performed in comparison with Python, Java, Go, and Rust.



Testing Methodology

The benchmark was conducted on identical cloud servers (8 vCPU, 32 GB RAM, SSD NVMe) running Ubuntu 24.04 LTS. The following scenarios were tested:

  • JSON Serialization — returning a simple object in JSON format (simulating a REST API).
  • Multithreaded Processing — parallel work with 64 concurrent requests.
  • Database Operations — 100,000 read/write operations via Entity Framework (C#), Hibernate (Java), SQLAlchemy (Python), and GORM (Go).
  • Algorithmic Load — array sorting and cryptographic hashing.


Results: Who Leads?

Based on the measurements, C# on .NET 9 confidently took second place, yielding only to Rust (average speed increase of 4–7% due to AOT compilation). However, the key metrics speak for themselves:

  • JSON Serialization (requests/sec): C# — 1,520,000, Go — 1,410,000, Java — 1,200,000, Python — 320,000.
  • Multithreading (speedup on 64 threads): C# — 42x, Java — 38x, Go — 35x, Python — 8x (GIL limitation).
  • Database Operations (ops/sec): C# — 85,000, Go — 81,000, Java — 74,000, Python — 22,000.
  • Memory consumption per 1,000 requests: C# — 12 MB, Rust — 8 MB, Go — 15 MB, Java — 28 MB, Python — 45 MB.


Why Does C# Win?

The .NET ecosystem continues to actively develop. In version .NET 9, the following optimizations were introduced:

  • New JIT compiler (Tiered PGO) — adapts code to real execution patterns.
  • Native AOT — pre-compilation to machine code, reducing startup time to 50 ms.
  • The System.Text.Json library — one of the fastest serialization implementations among all languages.
  • Asynchronous streams (IAsyncEnumerable) — minimal overhead for I/O.


Conclusions for Developers

If you are choosing a stack for a high-load microservice, C# (.NET) is a definite top-3 candidate. It is significantly faster than Python (4–5 times on typical tasks), consistently outperforms Java in speed and memory consumption, and surpasses Go and Rust in development convenience and tooling (IDE, debugger, profiler). The only downside is licensing for commercial projects (a Visual Studio license is required for Enterprise features), but the Community version covers most needs.

Recommended Libraries