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.8 17127 3.23 4.79 3.69
muffin 0.80.0 15098 3.49 5.52 4.20
falcon 3.0.1 14061 3.67 5.95 4.51
starlette 0.14.2 12342 4.17 6.82 5.15
emmett 2.2.3 12232 4.47 6.79 5.19
fastapi 0.65.2 8726 5.82 9.76 7.29
sanic 21.3.4 8171 6.36 10.22 7.84
aiohttp 3.7.4.post0 6886 9.30 9.50 9.29
quart 0.15.1 2769 23.02 24.88 23.12
tornado 6.1 2727 22.78 24.00 23.47
django 3.2.4 1660 38.65 42.10 38.57

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)
muffin 0.80.0 9280 5.43 9.27 6.86
blacksheep 1.0.8 9094 5.84 9.18 7.01
falcon 3.0.1 9002 5.58 9.57 7.07
starlette 0.14.2 7151 7.04 12.09 8.91
sanic 21.3.4 6871 7.23 12.37 9.31
emmett 2.2.3 6024 8.73 13.73 10.71
fastapi 0.65.2 5550 9.35 15.57 11.49
aiohttp 3.7.4.post0 4162 15.34 15.61 15.38
tornado 6.1 2445 26.11 26.54 26.16
quart 0.15.1 1792 34.83 36.78 35.70
django 3.2.4 1407 46.41 50.06 45.43

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.8 4932 10.30 17.39 12.95
muffin 0.80.0 3886 12.83 22.26 16.45
sanic 21.3.4 3649 14.16 23.34 17.50
falcon 3.0.1 3187 16.55 26.36 20.14
starlette 0.14.2 2148 25.47 38.99 29.75
aiohttp 3.7.4.post0 2049 31.18 31.73 31.21
fastapi 0.65.2 1915 38.09 43.03 33.37
tornado 6.1 1832 34.80 35.28 34.94
quart 0.15.1 1483 42.47 44.78 43.12
emmett 2.2.3 1231 49.02 57.71 51.92
django 3.2.4 904 69.48 78.94 70.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.8 467295 6.46 10.45 7.88
muffin 0.80.0 423960 7.25 12.35 9.17
falcon 3.0.1 393750 8.6 13.96 10.57
starlette 0.14.2 324615 12.23 19.3 14.6
emmett 2.2.3 292305 20.74 26.08 22.61
sanic 21.3.4 280365 9.25 15.31 11.55
fastapi 0.65.2 242865 17.75 22.79 17.38
aiohttp 3.7.4.post0 196455 18.61 18.95 18.63
tornado 6.1 105060 27.9 28.61 28.19
quart 0.15.1 90660 33.44 35.48 33.98
django 3.2.4 59565 51.51 57.03 51.56