DEV Community

Cover image for A benchmark of 23 web frameworks: the top 5 were Rust-based
venelouis
venelouis

Posted on

A benchmark of 23 web frameworks: the top 5 were Rust-based

🧪 Benchmark Methodology (4-Tier Architecture)

To simulate different real-world scenarios, our testing approach is divided into four robust tiers:

🌍 Tier 1: Fast Load (Baseline Performance)

  • Goal: Establish a baseline for raw Requests Per Second (RPS) and latency.
  • Load: 125 concurrent connections for 10 seconds.
  • Endpoints: /text, /json, /db-single, /html

⚡ Tier 2: Concurrency & Latency (High Traffic)

  • Goal: Evaluate behavior under sudden traffic spikes and measure P99 latency.
  • Load: 300 concurrent connections for 30 seconds.
  • Endpoints: /json

🧠 Tier 3: Resource Efficiency (Idle vs. Peak)

  • Goal: Identify CPU and RAM utilization of "greedy" vs. "efficient" architectures.
  • Method: Measure Docker stats during 0 traffic (Idle) vs. 200 concurrent connections (Peak).

🔥 Tier 4: Stress & Resilience (Memory Leak Detection)

  • Goal: Ensure frameworks don't crash or leak memory under prolonged stress.
  • Load: 500 concurrent connections for a sustained 2 minutes.
  • Endpoints: /json

🏅 The Efficiency Ranking Score (RPS/MB)

Our official ranking is determined by the Efficiency Score, which measures how many requests a framework can handle per megabyte of memory it consumes.

  • Formula: Efficiency = JSON RPS (Tier 1) / Peak RAM in MB (Tier 3)
  • Example: A framework handling 100,000 RPS with 20MB RAM scores 5,000. A framework handling 100,000 RPS with 200MB RAM scores 500.
  • The Disqualification Penalty: Any framework that drops connections, crashes, or returns timeout errors during the Tier 4 Stress Test is automatically disqualified and receives 0 Points. Speed is irrelevant if the server collapses under pressure!

💻 Minimum Hardware Requirements

To run these benchmarks locally without skewing the results due to resource starvation (especially during the 500-connection Tier 4 tests), we recommend the following minimum specifications:

  • CPU: 4 Cores / 8 Threads (8+ Cores recommended)
  • RAM: 8GB Minimum (16GB+ recommended)
  • OS: Linux, macOS, or Windows (WSL2)
  • Docker Engine: Ensure Docker is allocated at least 4 CPUs and 8GB of RAM.

📊 Official Tested Hardware

All benchmark results listed in this repository were run on the following environment to ensure consistency:

  • CPU: AMD Ryzen 7 5700U (8 Cores / 16 Threads)
  • RAM: 8GB
  • OS: Windows 11 (Docker with WSL2)

🗄️ Database Architecture

All frameworks connect to a dedicated PostgreSQL 15 container.

  • The database is initialized via the db-init scripts which pre-populate a table called world with thousands of random rows.
  • Frameworks must fetch the World record with ID = 1 for the /db-single endpoint. Connection pooling is strictly recommended.

The Top 10:

🏅 Official Efficiency Ranking

🏆 Rank Framework Language Efficiency (RPS/MB) JSON RPS DB Single RPS Avg Latency Peak RAM Status
🥇 1st Actix-Web Rust 6.778 128.654,31 12.366,9 2.34ms 18.98MiB ✅ Passed
🥈 2nd Axum Rust 4.580 100.620,33 18.033,16 2.61ms 21.97MiB ✅ Passed
🥉 3rd Poem Rust 4.346 98.795,48 12.405,22 2.68ms 22.73MiB ✅ Passed
4 Rullst 👑 Rust 4.344 90.485,67 16.186,7 3.14ms 20.83MiB ✅ Passed
5 Salvo Rust 4.141 92.218,37 7.465,66 2.96ms 22.27MiB ✅ Passed
6 Go-Fiber Go 4.032 99.803,89 16.026,64 2.68ms 24.75MiB ✅ Passed
7 Dioxus Rust 3.448 87.638,05 9.431,99 2.79ms 25.42MiB ✅ Passed
8 Leptos Rust 3.024 77.135,01 8.009 2.94ms 25.51MiB ✅ Passed
9 Go-Gin Go 2.898 70.219,4 13.627,19 4.14ms 24.23MiB ✅ Passed
10 ASP.NET Core C# 718 75.723,47 11.181,52 3.63ms 105.5MiB ✅ Passed

Do you want to see the top 23?
Here is the link: https://rullst.github.io/Benchmarks/
Link of the Repo: https://github.com/Rullst/Benchmarks/

Top comments (0)