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.7 19097 2.76 4.32 3.31
muffin 0.79.1 17129 3.08 4.85 3.70
falcon 3.0.1 15966 3.28 5.22 3.97
emmett 2.2.2 14029 3.72 5.96 4.53
starlette 0.14.2 14026 3.64 5.96 4.53
fastapi 0.65.2 10014 5.04 8.41 6.36
sanic 21.3.4 9330 5.29 8.97 6.86
aiohttp 3.7.4.post0 7869 8.08 8.25 8.13
quart 0.15.1 3520 18.88 19.52 18.16
tornado 6.1 3472 18.42 18.57 18.43
django 3.2.4 2036 31.48 35.03 31.48

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.7 10681 4.63 7.97 5.95
muffin 0.79.1 10645 4.63 8.03 5.98
falcon 3.0.1 10399 4.79 8.21 6.14
starlette 0.14.2 8209 6.03 10.50 7.76
sanic 21.3.4 7843 6.28 10.76 8.15
emmett 2.2.2 7456 6.61 11.20 8.62
fastapi 0.65.2 6447 7.60 13.34 9.89
aiohttp 3.7.4.post0 4854 13.11 13.30 13.18
tornado 6.1 2937 21.77 21.94 21.79
quart 0.15.1 2223 28.46 28.99 28.77
django 3.2.4 1708 39.12 41.10 37.44

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.7 6135 8.02 14.05 10.45
muffin 0.79.1 4672 10.52 18.58 13.72
sanic 21.3.4 4449 11.04 19.35 14.41
falcon 3.0.1 3825 13.56 21.96 16.77
starlette 0.14.2 2590 20.75 32.66 24.67
aiohttp 3.7.4.post0 2468 25.91 26.00 25.92
fastapi 0.65.2 2305 32.90 36.64 27.72
tornado 6.1 2294 27.90 27.95 27.89
quart 0.15.1 1894 33.69 34.27 33.78
emmett 2.2.2 1627 36.25 44.98 39.30
django 3.2.4 1091 58.60 65.08 58.55

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.7 538695 5.14 8.78 6.57
muffin 0.79.1 486690 6.08 10.49 7.8
falcon 3.0.1 452850 7.21 11.8 8.96
starlette 0.14.2 372375 10.14 16.37 12.32
emmett 2.2.2 346680 15.53 20.71 17.48
sanic 21.3.4 324330 7.54 13.03 9.81
fastapi 0.65.2 281490 15.18 19.46 14.66
aiohttp 3.7.4.post0 227865 15.7 15.85 15.74
tornado 6.1 130545 22.7 22.82 22.7
quart 0.15.1 114555 27.01 27.59 26.9
django 3.2.4 72525 43.07 47.07 42.49