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)
muffin 0.83.1 19405 3.78 4.04 3.26
blacksheep 1.0.8 19210 2.76 4.31 3.30
falcon 3.0.1 16180 3.17 5.20 3.92
starlette 0.15.0 15733 4.70 5.15 4.03
emmett 2.2.3 14041 3.58 6.10 4.53
fastapi 0.66.0 11073 6.88 7.32 5.74
sanic 21.6.0 9266 5.30 9.04 6.92
aiohttp 3.7.4.post0 7777 8.21 8.30 8.23
tornado 6.1 3534 18.11 18.21 18.11
quart 0.15.1 3508 18.83 19.57 18.23
django 3.2.5 2130 29.83 32.95 30.07

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.8 10812 4.57 7.93 5.88
muffin 0.83.1 10635 4.60 8.09 5.98
falcon 3.0.1 10515 4.71 8.22 6.06
starlette 0.15.0 8248 6.01 10.62 7.73
emmett 2.2.3 8084 8.97 10.08 8.05
sanic 21.6.0 7758 6.34 11.16 8.26
fastapi 0.66.0 6440 7.83 13.60 9.91
aiohttp 3.7.4.post0 4690 13.43 14.08 13.64
tornado 6.1 2947 21.71 21.88 21.72
quart 0.15.1 2159 29.23 29.85 29.63
django 3.2.5 1659 37.52 42.80 38.54

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 6146 8.01 14.27 10.42
muffin 0.83.1 4722 10.56 18.50 13.61
sanic 21.6.0 4331 11.29 20.19 14.77
falcon 3.0.1 3854 13.12 22.07 16.69
starlette 0.15.0 2548 19.42 34.34 25.08
aiohttp 3.7.4.post0 2377 26.87 27.39 26.90
fastapi 0.66.0 2277 21.51 38.22 28.07
tornado 6.1 2263 28.26 28.41 28.28
quart 0.15.1 1845 34.68 35.42 34.67
emmett 2.2.3 1663 36.43 42.10 38.46
django 3.2.5 1119 56.80 62.63 57.01

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 542520 5.11 8.84 6.53
muffin 0.83.1 521430 6.31 10.21 7.62
falcon 3.0.1 458235 7.0 11.83 8.89
starlette 0.15.0 397935 10.04 16.7 12.28
emmett 2.2.3 356820 16.33 19.43 17.01
sanic 21.6.0 320325 7.64 13.46 9.98
fastapi 0.66.0 296850 12.07 19.71 14.57
aiohttp 3.7.4.post0 222660 16.17 16.59 16.26
tornado 6.1 131160 22.69 22.83 22.7
quart 0.15.1 112680 27.58 28.28 27.51
django 3.2.5 73620 41.38 46.13 41.87