{"id":16543482,"url":"https://github.com/ajndkr/async-fastapi-gin-fiber","last_synced_at":"2026-05-08T05:55:10.870Z","repository":{"id":192451330,"uuid":"686709120","full_name":"ajndkr/async-fastapi-gin-fiber","owner":"ajndkr","description":"compare performance of FastAPI, Gin and Fiber frameworks","archived":false,"fork":false,"pushed_at":"2023-09-03T19:11:22.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T13:53:42.100Z","etag":null,"topics":["fastapi","fiber","gin","http-benchmarking"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajndkr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-03T17:33:11.000Z","updated_at":"2024-02-05T21:06:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"82d7218d-6f51-4e46-b788-2370c0f270cb","html_url":"https://github.com/ajndkr/async-fastapi-gin-fiber","commit_stats":null,"previous_names":["ajndkr/async-fastapi-gin-fiber"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajndkr%2Fasync-fastapi-gin-fiber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajndkr%2Fasync-fastapi-gin-fiber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajndkr%2Fasync-fastapi-gin-fiber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajndkr%2Fasync-fastapi-gin-fiber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajndkr","download_url":"https://codeload.github.com/ajndkr/async-fastapi-gin-fiber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241827078,"owners_count":20026599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","fiber","gin","http-benchmarking"],"created_at":"2024-10-11T19:00:21.881Z","updated_at":"2025-12-03T10:05:13.176Z","avatar_url":"https://github.com/ajndkr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI vs Gin vs Fiber\n\nAn experiment to compare performance of FastAPI, Gin and Fiber.\n\n## Overview:\n\n-   [Setup](#setup)\n-   [Run experiments](#run-experiments)\n-   [Results](#results)\n\n## Setup\n\n### FastAPI\n\nThe repository uses Python 3.11. Follow the steps below to get started:\n\n-   Create conda environment:\n\n    ```bash\n    conda create -n fastapi-tests python=3.11 -y\n    conda activate fastapi-tests\n    ```\n\n    You can choose any other environment manager of your choice.\n\n-   Install dependencies:\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n    **Note**: All requirement files are generated using `pip-tools`.\n\n### Gin\n\nThe repository uses Go 1.21. Follow the steps below to get started:\n\n-   Install dependencies:\n\n    ```bash\n    go mod tidy\n    ```\n\n## Run experiments\n\nBoth FastAPI and Gin applications serve one endpoint:\n\n- `/`: sleeps for 10 seconds and returns a response\n\n### FastAPI\n\nThe experiment uses `gunicorn` server to run the FastAPI application.\n\n```bash\ngunicorn -k uvicorn.workers.UvicornWorker app:app\n```\n\n### Gin\n\nThe experiment uses `gin` server to run the Gin application.\n\n```bash\ngo run gin/app.go\n```\n\n### Fiber\n\nThe experiment uses `fiber` server to run the Fiber application.\n\n```bash\ngo run fiber/app.go\n```\n\n### wrk Benchmarking\n\nRun the benchmarking script:\n\n```bash\n./benchmark.sh\n```\n\n**Note**: The script uses `wrk` to run benchmarks on http://localhost:8000.\nYou should benchmark one application at a time.\n\n## Results\n\n### FastAPI\n\n```bash\nRunning 1m test @ http://localhost:8000/\n  4 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    10.01s     5.65ms  10.02s    83.40%\n    Req/Sec    23.08     52.04   180.00     87.50%\n  500 requests in 1.00m, 71.29KB read\nRequests/sec:      8.33\nTransfer/sec:      1.19KB\n```\n\n### Gin\n\n```bash\nRunning 1m test @ http://localhost:8000/\n  4 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    10.01s     4.34ms  10.02s    57.20%\n    Req/Sec     9.87     21.25    70.00     86.96%\n  500 requests in 1.00m, 70.31KB read\nRequests/sec:      8.33\nTransfer/sec:      1.17KB\n```\n\n### Fiber\n\n```bash\nRunning 1m test @ http://localhost:8000/\n  4 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    10.00s     3.22ms  10.01s    80.00%\n    Req/Sec     2.00      0.00     2.00    100.00%\n  500 requests in 1.00m, 62.99KB read\nRequests/sec:      8.33\nTransfer/sec:      1.05KB\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajndkr%2Fasync-fastapi-gin-fiber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajndkr%2Fasync-fastapi-gin-fiber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajndkr%2Fasync-fastapi-gin-fiber/lists"}