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.9 18871 3.05 4.31 3.36
muffin 0.84.5 16612 3.49 4.93 3.81
falcon 3.0.1 15754 4.07 5.17 4.02
starlette 0.16.0 13725 4.22 6.01 4.63
emmett 2.3.1 13516 4.17 6.10 4.70
fastapi 0.68.1 9709 5.86 8.56 6.56
sanic 21.6.2 8866 6.06 9.42 7.22
aiohttp 3.7.4.post0 7457 8.58 8.84 8.58
quart 0.15.1 3338 19.26 20.61 19.15
tornado 6.1 3310 19.15 19.80 19.33
django 3.2.6 1852 34.37 37.97 34.65

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.9 10385 5.20 8.05 6.13
falcon 3.0.1 10309 6.09 8.03 6.17
muffin 0.84.5 10212 5.24 8.21 6.23
starlette 0.16.0 7966 6.66 10.55 8.00
sanic 21.6.2 7432 6.97 11.28 8.60
emmett 2.3.1 7211 7.22 11.54 8.93
fastapi 0.68.1 6260 8.49 13.46 10.19
aiohttp 3.7.4.post0 4564 14.05 14.38 14.03
tornado 6.1 2783 22.95 23.63 23.00
quart 0.15.1 2095 30.16 31.36 30.53
django 3.2.6 1566 41.41 44.99 40.82

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.9 5871 9.10 14.32 10.91
muffin 0.84.5 4483 14.01 18.75 14.28
sanic 21.6.2 4143 13.95 20.19 15.44
falcon 3.0.1 3743 17.80 22.05 17.19
starlette 0.16.0 2432 29.97 33.69 26.25
aiohttp 3.7.4.post0 2235 28.52 29.20 28.63
tornado 6.1 2224 28.67 29.34 28.77
fastapi 0.68.1 2218 32.63 36.66 28.81
quart 0.15.1 1806 35.19 36.32 35.42
emmett 2.3.1 1477 40.70 48.60 43.29
django 3.2.6 986 65.19 72.05 64.80

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.9 526905 5.78 8.89 6.8
muffin 0.84.5 469605 7.58 10.63 8.11
falcon 3.0.1 447090 9.32 11.75 9.13
starlette 0.16.0 361845 13.62 16.75 12.96
emmett 2.3.1 333060 17.36 22.08 18.97
sanic 21.6.2 306615 8.99 13.63 10.42
fastapi 0.68.1 272805 15.66 19.56 15.19
aiohttp 3.7.4.post0 213840 17.05 17.47 17.08
tornado 6.1 124755 23.59 24.26 23.7
quart 0.15.1 108585 28.2 29.43 28.37
django 3.2.6 66060 46.99 51.67 46.76