Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/malkiii/fastapi-fastify-hono-benchmark
- Owner: malkiii
- Created: 2024-12-19T14:44:38.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2025-01-26T17:36:19.000Z (17 days ago)
- Last Synced: 2025-02-05T10:39:17.350Z (8 days ago)
- Topics: api, docker, fastapi, fastify, honojs, mongodb, nodejs, python
- Language: Jupyter Notebook
- Homepage:
- Size: 354 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.