{"id":13502097,"url":"https://github.com/klen/py-frameworks-bench","last_synced_at":"2025-06-17T10:13:11.708Z","repository":{"id":31315070,"uuid":"34877469","full_name":"klen/py-frameworks-bench","owner":"klen","description":"Another benchmark for some python frameworks","archived":false,"fork":false,"pushed_at":"2024-05-11T21:29:53.000Z","size":351,"stargazers_count":720,"open_issues_count":20,"forks_count":87,"subscribers_count":26,"default_branch":"develop","last_synced_at":"2025-06-11T19:34:25.956Z","etag":null,"topics":["benchmark","python-frameworks"],"latest_commit_sha":null,"homepage":"https://klen.github.io/py-frameworks-bench/","language":"Python","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/klen.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":"2015-04-30T21:22:38.000Z","updated_at":"2025-05-07T01:22:19.000Z","dependencies_parsed_at":"2024-07-09T22:12:34.212Z","dependency_job_id":"ce68ce31-12cc-449f-b9a6-f9d700763496","html_url":"https://github.com/klen/py-frameworks-bench","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/klen/py-frameworks-bench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fpy-frameworks-bench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fpy-frameworks-bench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fpy-frameworks-bench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fpy-frameworks-bench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klen","download_url":"https://codeload.github.com/klen/py-frameworks-bench/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fpy-frameworks-bench/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260336371,"owners_count":22993742,"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":["benchmark","python-frameworks"],"created_at":"2024-07-31T22:02:01.689Z","updated_at":"2025-06-17T10:13:06.694Z","avatar_url":"https://github.com/klen.png","language":"Python","readme":"# Async Python Web Frameworks comparison\n\nhttps://klen.github.io/py-frameworks-bench/\n----------\n#### Updated: 2022-03-14\n\n[![benchmarks](https://github.com/klen/py-frameworks-bench/actions/workflows/benchmarks.yml/badge.svg)](https://github.com/klen/py-frameworks-bench/actions/workflows/benchmarks.yml)\n[![tests](https://github.com/klen/py-frameworks-bench/actions/workflows/tests.yml/badge.svg)](https://github.com/klen/py-frameworks-bench/actions/workflows/tests.yml)\n\n----------\n\nThis is a simple benchmark for python async frameworks. Almost all of the\nframeworks are ASGI-compatible (aiohttp and tornado are exceptions on the\nmoment).\n\nThe objective of the benchmark is not testing deployment (like uvicorn vs\nhypercorn and etc) or database (ORM, drivers) but instead test the frameworks\nitself. The benchmark checks request parsing (body, headers, formdata,\nqueries), routing, responses.\n\n## Table of contents\n\n* [The Methodic](#the-methodic)\n* [The Results](#the-results-2022-03-14)\n    * [Accept a request and return HTML response with a custom dynamic header](#html)\n    * [Parse path params, query string, JSON body and return a json response](#api)\n    * [Parse uploaded file, store it on disk and return a text response](#upload)\n    * [Composite stats ](#composite)\n\n\n\n\u003cimg src='https://quickchart.io/chart?width=800\u0026height=400\u0026c=%7Btype%3A%22bar%22%2Cdata%3A%7Blabels%3A%5B%22blacksheep%22%2C%22sanic%22%2C%22muffin%22%2C%22falcon%22%2C%22starlette%22%2C%22baize%22%2C%22emmett%22%2C%22fastapi%22%2C%22aiohttp%22%2C%22tornado%22%2C%22quart%22%2C%22django%22%5D%2Cdatasets%3A%5B%7Blabel%3A%22num%20of%20req%22%2Cdata%3A%5B519825%2C470400%2C469725%2C436800%2C365490%2C349425%2C328275%2C255615%2C209310%2C121185%2C109755%2C38610%5D%7D%5D%7D%7D' /\u003e\n\n## The Methodic\n\nThe benchmark runs as a [Github Action](https://github.com/features/actions).\nAccording to the [github\ndocumentation](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners)\nthe hardware specification for the runs is:\n\n* 2-core vCPU (Intel® Xeon® Platinum 8272CL (Cascade Lake), Intel® Xeon® 8171M 2.1GHz (Skylake))\n* 7 GB of RAM memory\n* 14 GB of SSD disk space\n* OS Ubuntu 20.04\n\n[ASGI](https://asgi.readthedocs.io/en/latest/) apps are running from docker using the gunicorn/uvicorn command:\n\n    gunicorn -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8080 app:app\n\nApplications' source code can be found\n[here](https://github.com/klen/py-frameworks-bench/tree/develop/frameworks).\n\nResults received with WRK utility using the params:\n\n    wrk -d15s -t4 -c64 [URL]\n\nThe benchmark has a three kind of tests:\n\n1. \"Simple\" test: accept a request and return HTML response with custom dynamic\n   header. The test simulates just a single HTML response.\n\n2. \"API\" test: Check headers, parse path params, query string, JSON body and return a json\n   response. The test simulates an JSON REST API.\n\n3. \"Upload\" test: accept an uploaded file and store it on disk. The test\n   simulates multipart formdata processing and work with files.\n\n\n## The Results (2022-03-14)\n\n\u003ch3 id=\"html\"\u003e Accept a request and return HTML response with a custom dynamic header\u003c/h3\u003e\n\u003cdetails open\u003e\n\u003csummary\u003e The test simulates just a single HTML response. \u003c/summary\u003e\n\nSorted by max req/s\n\n| Framework | Requests/sec | Latency 50% (ms) | Latency 75% (ms) | Latency Avg (ms) |\n| --------- | -----------: | ---------------: | ---------------: | ---------------: |\n| [blacksheep](https://pypi.org/project/blacksheep/) `1.2.5` | 18546 | 2.80 | 4.53 | 3.41\n| [muffin](https://pypi.org/project/muffin/) `0.87.0` | 16571 | 3.09 | 5.17 | 3.83\n| [sanic](https://pypi.org/project/sanic/) `21.12.1` | 15558 | 4.70 | 5.14 | 4.08\n| [falcon](https://pypi.org/project/falcon/) `3.0.1` | 15554 | 3.29 | 5.49 | 4.08\n| [baize](https://pypi.org/project/baize/) `0.15.0` | 13880 | 3.69 | 6.21 | 4.58\n| [starlette](https://pypi.org/project/starlette/) `0.17.1` | 13797 | 3.70 | 6.16 | 4.60\n| [emmett](https://pypi.org/project/emmett/) `2.4.5` | 13380 | 5.54 | 6.10 | 4.75\n| [fastapi](https://pypi.org/project/fastapi/) `0.75.0` | 9060 | 5.46 | 9.79 | 7.03\n| [aiohttp](https://pypi.org/project/aiohttp/) `3.8.1` | 7240 | 8.74 | 9.01 | 8.84\n| [quart](https://pypi.org/project/quart/) `0.16.3` | 3425 | 18.99 | 20.08 | 18.68\n| [tornado](https://pypi.org/project/tornado/) `6.1` | 3232 | 19.76 | 19.94 | 19.81\n| [django](https://pypi.org/project/django/) `4.0.3` | 1002 | 59.00 | 66.26 | 63.72\n\n\n\u003c/details\u003e\n\n\u003ch3 id=\"api\"\u003e Parse path params, query string, JSON body and return a json response\u003c/h3\u003e\n\u003cdetails open\u003e\n\u003csummary\u003e The test simulates a simple JSON REST API endpoint.  \u003c/summary\u003e\n\nSorted by max req/s\n\n| Framework | Requests/sec | Latency 50% (ms) | Latency 75% (ms) | Latency Avg (ms) |\n| --------- | -----------: | ---------------: | ---------------: | ---------------: |\n| [sanic](https://pypi.org/project/sanic/) `21.12.1` | 10777 | 6.97 | 7.67 | 5.90\n| [blacksheep](https://pypi.org/project/blacksheep/) `1.2.5` | 10505 | 4.70 | 8.16 | 6.07\n| [muffin](https://pypi.org/project/muffin/) `0.87.0` | 10319 | 4.79 | 8.41 | 6.17\n| [falcon](https://pypi.org/project/falcon/) `3.0.1` | 10133 | 4.88 | 8.61 | 6.28\n| [starlette](https://pypi.org/project/starlette/) `0.17.1` | 8135 | 6.03 | 10.76 | 7.83\n| [emmett](https://pypi.org/project/emmett/) `2.4.5` | 7091 | 7.17 | 11.58 | 9.12\n| [baize](https://pypi.org/project/baize/) `0.15.0` | 6581 | 9.96 | 10.24 | 9.71\n| [fastapi](https://pypi.org/project/fastapi/) `0.75.0` | 5882 | 8.36 | 15.16 | 10.85\n| [aiohttp](https://pypi.org/project/aiohttp/) `3.8.1` | 4496 | 14.15 | 14.32 | 14.24\n| [tornado](https://pypi.org/project/tornado/) `6.1` | 2780 | 22.95 | 23.17 | 23.02\n| [quart](https://pypi.org/project/quart/) `0.16.3` | 2146 | 29.42 | 30.05 | 29.81\n| [django](https://pypi.org/project/django/) `4.0.3` | 883 | 68.00 | 71.74 | 72.37\n\n\u003c/details\u003e\n\n\u003ch3 id=\"upload\"\u003e Parse uploaded file, store it on disk and return a text response\u003c/h3\u003e\n\u003cdetails open\u003e\n\u003csummary\u003e The test simulates multipart formdata processing and work with files.  \u003c/summary\u003e\n\nSorted by max req/s\n\n| Framework | Requests/sec | Latency 50% (ms) | Latency 75% (ms) | Latency Avg (ms) |\n| --------- | -----------: | ---------------: | ---------------: | ---------------: |\n| [blacksheep](https://pypi.org/project/blacksheep/) `1.2.5` | 5604 | 8.87 | 15.77 | 11.40\n| [sanic](https://pypi.org/project/sanic/) `21.12.1` | 5025 | 10.44 | 16.83 | 12.72\n| [muffin](https://pypi.org/project/muffin/) `0.87.0` | 4425 | 11.14 | 19.99 | 14.43\n| [falcon](https://pypi.org/project/falcon/) `3.0.1` | 3433 | 14.56 | 25.48 | 18.73\n| [baize](https://pypi.org/project/baize/) `0.15.0` | 2834 | 21.89 | 24.48 | 22.57\n| [starlette](https://pypi.org/project/starlette/) `0.17.1` | 2434 | 20.10 | 36.39 | 26.26\n| [aiohttp](https://pypi.org/project/aiohttp/) `3.8.1` | 2218 | 28.81 | 29.09 | 28.84\n| [fastapi](https://pypi.org/project/fastapi/) `0.75.0` | 2099 | 23.61 | 41.91 | 30.44\n| [tornado](https://pypi.org/project/tornado/) `6.1` | 2067 | 30.89 | 31.09 | 30.95\n| [quart](https://pypi.org/project/quart/) `0.16.3` | 1746 | 36.68 | 37.58 | 36.63\n| [emmett](https://pypi.org/project/emmett/) `2.4.5` | 1414 | 41.83 | 50.86 | 45.21\n| [django](https://pypi.org/project/django/) `4.0.3` | 689 | 86.45 | 89.44 | 92.51\n\n\n\u003c/details\u003e\n\n\u003ch3 id=\"composite\"\u003e Composite stats \u003c/h3\u003e\n\u003cdetails open\u003e\n\u003csummary\u003e Combined benchmarks results\u003c/summary\u003e\n\nSorted by completed requests\n\n| Framework | Requests completed | Avg Latency 50% (ms) | Avg Latency 75% (ms) | Avg Latency (ms) |\n| --------- | -----------------: | -------------------: | -------------------: | ---------------: |\n| [blacksheep](https://pypi.org/project/blacksheep/) `1.2.5` | 519825 | 5.46 | 9.49 | 6.96\n| [sanic](https://pypi.org/project/sanic/) `21.12.1` | 470400 | 7.37 | 9.88 | 7.57\n| [muffin](https://pypi.org/project/muffin/) `0.87.0` | 469725 | 6.34 | 11.19 | 8.14\n| [falcon](https://pypi.org/project/falcon/) `3.0.1` | 436800 | 7.58 | 13.19 | 9.7\n| [starlette](https://pypi.org/project/starlette/) `0.17.1` | 365490 | 9.94 | 17.77 | 12.9\n| [baize](https://pypi.org/project/baize/) `0.15.0` | 349425 | 11.85 | 13.64 | 12.29\n| [emmett](https://pypi.org/project/emmett/) `2.4.5` | 328275 | 18.18 | 22.85 | 19.69\n| [fastapi](https://pypi.org/project/fastapi/) `0.75.0` | 255615 | 12.48 | 22.29 | 16.11\n| [aiohttp](https://pypi.org/project/aiohttp/) `3.8.1` | 209310 | 17.23 | 17.47 | 17.31\n| [tornado](https://pypi.org/project/tornado/) `6.1` | 121185 | 24.53 | 24.73 | 24.59\n| [quart](https://pypi.org/project/quart/) `0.16.3` | 109755 | 28.36 | 29.24 | 28.37\n| [django](https://pypi.org/project/django/) `4.0.3` | 38610 | 71.15 | 75.81 | 76.2\n\n\u003c/details\u003e\n\n## Conclusion\n\nNothing here, just some measures for you.\n\n## License\n\nLicensed under a MIT license (See LICENSE file)","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fpy-frameworks-bench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklen%2Fpy-frameworks-bench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fpy-frameworks-bench/lists"}