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.3 15596 3.25 5.60 4.08
muffin 0.70.1 13741 3.66 6.42 4.64
falcon 3.0.0 12348 4.03 7.25 5.15
starlette 0.14.2 11304 4.43 7.86 5.64
emmett 2.2.1 10721 4.63 8.25 5.94
fastapi 0.63.0 7877 6.29 11.34 8.10
sanic 21.3.4 6926 7.16 12.99 9.24
aiohttp 3.7.4.post0 5423 11.62 12.03 11.80
quart 0.14.1 3025 21.15 23.51 21.14
tornado 6.1 2525 25.21 25.71 25.34
django 3.2.2 1451 43.27 49.22 44.08

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 4605 10.77 19.56 13.87
sanic 21.3.4 3491 14.20 26.21 18.31
muffin 0.70.1 3459 14.24 25.93 18.51
falcon 3.0.0 3061 16.22 28.88 20.96
starlette 0.14.2 2126 23.13 43.13 30.07
aiohttp 3.7.4.post0 2029 31.07 32.33 31.60
fastapi 0.63.0 1950 24.91 46.64 32.78
tornado 6.1 1778 35.57 36.49 35.96
emmett 2.2.1 1324 45.45 54.10 48.29
quart 0.14.1 1200 53.92 55.89 53.28
django 3.2.2 855 72.10 84.09 74.64

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 8217 6.05 10.93 7.76
falcon 3.0.0 7777 6.45 11.62 8.20
muffin 0.70.1 7515 6.72 11.86 8.49
starlette 0.14.2 6132 8.13 14.76 10.41
sanic 21.3.4 5871 8.50 15.48 10.89
emmett 2.2.1 5529 8.85 16.05 11.59
fastapi 0.63.0 4749 10.41 19.05 13.45
aiohttp 3.7.4.post0 3436 18.34 19.20 18.62
tornado 6.1 2062 30.29 31.82 31.03
quart 0.14.1 1909 33.68 34.92 33.51
django 3.2.2 1257 48.88 57.10 50.83

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 426270 6.69 12.03 8.57
muffin 0.70.1 370725 8.21 14.74 10.55
falcon 3.0.0 347790 8.9 15.92 11.44
starlette 0.14.2 293430 11.9 21.92 15.37
emmett 2.2.1 263610 19.64 26.13 21.94
sanic 21.3.4 244320 9.95 18.23 12.81
fastapi 0.63.0 218640 13.87 25.68 18.11
aiohttp 3.7.4.post0 163320 20.34 21.19 20.67
tornado 6.1 95475 30.36 31.34 30.78
quart 0.14.1 92010 36.25 38.11 35.98
django 3.2.2 53445 54.75 63.47 56.52