Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/malkiii/fastapi-fastify-hono-benchmark

Comparing the performance of the fastest three web frameworks: FastAPI, Fastify, and Hono using AutoCannon for benchmarking tests to highlight their strengths and suitability for different types of workloads.
https://github.com/malkiii/fastapi-fastify-hono-benchmark

api docker fastapi fastify honojs mongodb nodejs python

Last synced: about 4 hours ago
JSON representation

Comparing the performance of the fastest three web frameworks: FastAPI, Fastify, and Hono using AutoCannon for benchmarking tests to highlight their strengths and suitability for different types of workloads.

Awesome Lists containing this project

README

        

# FastAPI vs Fastify vs Hono.js

This is a benchmark test of these "Fast" backend frameworks to see which one can handle the most requests per second using [AutoCannon](https://github.com/mcollina/autocannon).

## 📋 Requirements

- Node.js v22.12.0 or above.
- Python 3.13.0 or above and [Jupyter Notebook](https://jupyter.org/).
- [Docker](https://www.docker.com/) CLI.

## 💻 Local Setup

1. Install Node.js dev-dependencies using

```sh
npm install
```

2. Install Python `matplotlib` and `numpy` dependencies using:

```sh
pip install matplotlib numpy
```

## 📊 Benchmarking

1. Start `fastapi`, `fastify`, `hono`, and `mongodb` containers by opening a new terminal tab at the **root directory** and running:

```sh
npm start
```

2. Check if everything is running correctly using:

```sh
npm run test
```

3. Start benchmarking by running:

```sh
npm run benchmark
```

> [!NOTE]
> After completing these steps, you can check the results in the [report.ipynb](./report.ipynb) file. Your results may be completely different from mine.