This is a simple benchmark for python async frameworks. Almost all of the frameworks are ASGI-compatible (aiohttp is an exception).

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.3 14770 3.44 5.94 4.31
muffin 0.69.5 12502 4.07 7.01 5.10
starlette 0.14.2 12262 4.16 7.21 5.20
falcon 3.0.0 11885 4.25 7.45 5.36
emmett 2.2.1 10323 4.93 8.59 6.18
fastapi 0.63.0 8223 6.13 10.72 7.76
sanic 21.3.4 6733 7.41 12.96 9.51
aiohttp 3.7.4.post0 5754 11.05 11.43 11.12
quart 0.14.1 2927 20.15 24.56 21.85
django 3.2 1455 41.74 49.44 43.96

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.3 4391 11.33 20.30 14.61
muffin 0.69.5 3379 14.84 27.14 18.91
sanic 21.3.4 3366 14.61 26.24 18.98
falcon 3.0.0 2957 16.87 30.01 21.68
starlette 0.14.2 2109 23.30 43.02 30.32
aiohttp 3.7.4.post0 2029 31.21 32.66 31.53
fastapi 0.63.0 1923 25.53 46.67 33.25
emmett 2.2.1 1273 47.13 55.75 50.24
quart 0.14.1 1180 55.15 57.09 54.19
django 3.2 822 75.13 87.49 77.68

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.3 7801 6.50 11.44 8.18
falcon 3.0.0 7555 6.68 11.91 8.45
muffin 0.69.5 7216 7.04 12.45 8.85
starlette 0.14.2 6309 8.04 14.48 10.12
sanic 21.3.4 5620 8.86 15.85 11.38
emmett 2.2.1 5320 9.31 16.83 12.05
fastapi 0.63.0 4799 10.32 18.73 13.31
aiohttp 3.7.4.post0 3528 17.97 18.73 18.15
quart 0.14.1 1862 34.54 35.88 34.35
django 3.2 1248 49.22 57.56 51.25

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.3 404430 7.09 12.56 9.03
muffin 0.69.5 346455 8.65 15.53 10.95
falcon 3.0.0 335955 9.27 16.46 11.83
starlette 0.14.2 310200 11.83 21.57 15.21
emmett 2.2.1 253740 20.46 27.06 22.82
sanic 21.3.4 235785 10.29 18.35 13.29
fastapi 0.63.0 224175 13.99 25.37 18.11
aiohttp 3.7.4.post0 169665 20.08 20.94 20.27
quart 0.14.1 89535 36.61 39.18 36.8
django 3.2 52875 55.36 64.83 57.63