https://github.com/drarox/backend-benchmark
A fully automated benchmarking suite comparing popular backend frameworks.
https://github.com/drarox/backend-benchmark
backend benchmark bun deno go nodejs python
Last synced: 2 months ago
JSON representation
A fully automated benchmarking suite comparing popular backend frameworks.
- Host: GitHub
- URL: https://github.com/drarox/backend-benchmark
- Owner: Drarox
- License: mit
- Created: 2025-05-21T17:00:41.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-10-17T14:42:20.000Z (8 months ago)
- Last Synced: 2025-10-18T17:20:33.885Z (8 months ago)
- Topics: backend, benchmark, bun, deno, go, nodejs, python
- Language: Blade
- Homepage:
- Size: 322 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backend Benchmark
A fully automated benchmarking suite comparing popular backend frameworks (Python, Go, Node, etc.). It measures performance on a consistent JSON-processing route and outputs a standalone HTML dashboard with visual results.
## โก What It Does
* Benchmarks dozens of frameworks across languages
* Measures Requests/sec, Latency, Transfer/sec
* Generates a zero-dependency HTML dashboard with charts + system info (`results_dashboard.html`)
## ๐ฆ Frameworks Covered
- **Python**: Flask (with Gunicorn), FastAPI (with Uvicorn), Django (with Uvicorn + Gunicorn)
- **JavaScript Runtimes**:
- **Node**: Node (native), Express, Fastify, NestJS (Express), NestJS (Fastify), Koa
- **Bun**: Bun (native), Express, Hono, Elysia
- **Deno**: Deno (native), Express, Hono
- **Go**: Gin, Echo, Fiber, Native `net/http`
- **PHP**: Lavarel (with FrankenPHP)
- **Java**: Spring Boot
- **C#**: ASP.NET Core
- **Ruby**: Ruby on Rails
## ๐ฌ Benchmark Scenario
### Route: `POST /process`
- Input JSON: `{ "numbers": [1, 2, 3, 4, 5] }`
- Task: Compute the sum of squares of the numbers
- Output JSON: `{ "result": 55 }`
Each framework is tested using:
```bash
wrk -t"$CORES" -c1000 -d60s -s post.lua http://localhost:3000/process
```
## ๐ Project Structure
```
backend-benchmark/
โโโ / # One folder per framework
โ โโโ install.sh # Install dependencies of the framework (optional)
โ โโโ start.sh # Starts that framework's server
โโโ results/ # Results ouput folder
โ โโโ raw/ # Raw wrk output per framework
โ โโโ results_summary.csv # Parsed performance data
โ โโโ results_dashboard.html # Interactive HTML report
โโโ post.lua # wrk load script
โโโ benchmark_presetup.sh # Install all dependencies
โโโ benchmark_runner.sh # Run benchmarks
โโโ parse_html.py # Parses wrk results into charts
```
## ๐ง Prerequisites
Install the following tools:
* [Python 3.11+](https://www.python.org/)
* [Node.js](https://nodejs.org/)
* [Go](https://golang.org/)
* [Deno](https://deno.land/)
* [Bun](https://bun.sh/)
* [PHP](https://www.php.net/) + [Composer](https://getcomposer.org/)
* [Java](https://www.java.com/)
* [Dotnet](https://dotnet.microsoft.com/)
* [Ruby](https://www.ruby-lang.org/)
* [`wrk`](https://github.com/wg/wrk)
Ensure each tool is available in your `PATH`.
## ๐ Usage
#### 1. Clone & enter project
```bash
git clone https://github.com/Drarox/Backend-Benchmark.git
cd backend-benchmark
```
#### 2. Run presetup (install dependencies per framework)
```bash
./benchmark_presetup.sh
```
#### 3. Run benchmarks (fully automated)
```bash
./benchmark_runner.sh
```
This will:
* Sequentially start each framework server
* Run a high-load test using [`wrk`](https://github.com/wg/wrk)
* Kill the server
* Save results in `results/`
* Generate `results_dashboard.html`
## ๐ณ Run with Docker (No Host Dependencies)
Don't want to install Python, Node, Go, Deno, Bun, or wrk on your machine?
No problem: everything runs cleanly inside a container.
The Docker image installs all the prerequisites !
### โ
One-Time: Build the Docker image
```bash
docker build -t backend-benchmark .
```
### ๐ Run the full benchmark suite
```bash
docker run --rm -v "$PWD/results:/app/results" backend-benchmark
```
* Benchmarks all frameworks
* Generates the HTML dashboard
* Mounts results to your host in the `results/` folder
This lets you run the full suite **with zero host setup** and clean everything up with one `docker rmi`.
## ๐งพ Benchmark Results
Results from Octoboer 20, 2025
*Changelog: Lavarel, Spring Boot, ASP.NET Core, Ruby On Rails and Koa added*
* **macOS** โ M1 Pro (8-core), 16โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_macos_20251020.html)
* **macOS (Docker Desktop)** โ M1 Pro (8-core), 8โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_macos_docker_20251020.html)
### Historical Results
Results from May 28, 2025
*Changelog: First run of the benchmark*
* **macOS** โ M1 Pro (8-core), 16โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_macos_20250528.html)
* **macOS (Docker Desktop)** โ M1 Pro (8-core), 8โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_macos_docker_20250528.html)
* **Ubuntu (Docker)** โ Xeon D-1531 (6-core), 32โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_ubuntu1_docker_20250528.html)
* **Ubuntu** โ Xeon D-1531 (6-core), 32โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_ubuntu1_20250530.html)
* **Ubuntu (Docker)** โ AMD Ryzen 7 1700X (8-core), 24โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_ubuntu2_docker_20250530.html)
Results from October 10, 2025
*Changelog: Runtime and package updated*
* **macOS** โ M1 Pro (8-core), 16โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_macos_20251010.html)
* **macOS (Docker Desktop)** โ M1 Pro (8-core), 8โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_macos_docker_20251010.html)
* **Ubuntu (Docker)** โ Xeon D-1531 (6-core), 32โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_ubuntu1_docker_20251010.html)
* **Ubuntu** โ Xeon D-1531 (6-core), 32โฏGB RAM โ [View dashboard](https://yannick-burkard.eu.org/backend-benchmark/results_dashboard_ubuntu1_20251010.html)
## ๐ค Contributing
Pull requests welcome! Add frameworks, improve charts, or enhance the automation. Feel free to fork this repository and submit a [pull request](https://github.com/Drarox/Backend-Benchmark/pulls) with your changes.
## ๐ License
MIT โ use freely, modify openly, benchmark responsibly.