DEV Community

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

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)