An open API service indexing awesome lists of open source software.

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.

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.