This is a simple benchmark for python async frameworks. Almost all of the frameworks are ASGI-compatible (aiohttp and tornado are exceptions on the moment).

The objective of the benchmark is not testing deployment (like uvicorn vs hypercorn and etc) or database (ORM, drivers) but instead test the frameworks itself. The benchmark checks request parsing (body, headers, formdata, queries), routing, responses.

Read more about the benchmark: The Methodic

Table of contents

Accept a request and return HTML response with a custom dynamic header

The test simulates just a single HTML response.

Sorted by max req/s

Framework Requests/sec Latency 50% (ms) Latency 75% (ms) Latency Avg (ms)
blacksheep 1.0.6 19619 2.71 4.19 3.23
muffin 0.79.1 17259 3.03 4.79 3.67
falcon 3.0.1 16225 3.16 5.17 3.91
starlette 0.14.2 14199 3.60 5.88 4.48
emmett 2.2.2 13994 3.66 6.02 4.54
fastapi 0.65.1 10084 4.91 8.41 6.31
sanic 21.3.4 9210 5.38 9.12 6.97
aiohttp 3.7.4.post0 7755 8.20 8.26 8.25
tornado 6.1 3510 18.14 18.33 18.23
quart 0.15.1 3475 19.01 19.85 18.43
django 3.2.4 1969 31.32 35.95 32.52

Parse uploaded file, store it on disk and return a text response

The test simulates multipart formdata processing and work with files.

Sorted by max req/s

Framework Requests/sec Latency 50% (ms) Latency 75% (ms) Latency Avg (ms)
blacksheep 1.0.6 6224 7.84 14.03 10.26
muffin 0.79.1 4711 10.48 18.75 13.56
sanic 21.3.4 4430 11.03 19.65 14.53
falcon 3.0.1 3858 12.79 22.23 16.68
starlette 0.14.2 2570 19.09 34.01 24.87
aiohttp 3.7.4.post0 2436 26.25 26.42 26.26
fastapi 0.65.1 2329 20.88 37.19 27.44
tornado 6.1 2305 27.71 27.85 27.77
quart 0.15.1 1870 34.15 34.91 34.20
emmett 2.2.2 1586 37.12 45.56 40.31
django 3.2.4 1048 60.45 67.23 60.96

Parse path params, query string, JSON body and return a json response

The test simulates a simple JSON REST API endpoint.

Sorted by max req/s

Framework Requests/sec Latency 50% (ms) Latency 75% (ms) Latency Avg (ms)
blacksheep 1.0.6 11029 4.47 7.83 5.77
muffin 0.79.1 10567 4.67 8.08 6.02
falcon 3.0.1 10457 4.80 8.16 6.09
starlette 0.14.2 8279 5.93 10.36 7.70
sanic 21.3.4 7792 6.23 10.86 8.22
emmett 2.2.2 7313 6.61 11.63 8.88
fastapi 0.65.1 6439 7.57 13.56 9.90
aiohttp 3.7.4.post0 4880 13.04 13.27 13.11
tornado 6.1 2905 22.01 22.23 22.03
quart 0.15.1 2180 28.83 29.63 29.32
django 3.2.4 1654 39.47 42.65 38.67

Composite stats

Combined benchmarks results

Sorted by completed requests

Framework Requests completed Avg Latency 50% (ms) Avg Latency 75% (ms) Avg Latency (ms)
blacksheep 1.0.6 553080 5.01 8.68 6.42
muffin 0.79.1 488055 6.06 10.54 7.75
falcon 3.0.1 458100 6.92 11.85 8.89
starlette 0.14.2 375720 9.54 16.75 12.35
emmett 2.2.2 343395 15.8 21.07 17.91
sanic 21.3.4 321480 7.55 13.21 9.91
fastapi 0.65.1 282780 11.12 19.72 14.55
aiohttp 3.7.4.post0 226065 15.83 15.98 15.87
tornado 6.1 130800 22.62 22.8 22.68
quart 0.15.1 112875 27.33 28.13 27.32
django 3.2.4 70065 43.75 48.61 44.05