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.6 19594 2.81 4.14 3.23
muffin 0.78.0 17283 3.07 4.78 3.67
falcon 3.0.1 16006 3.29 5.19 3.96
emmett 2.2.1 14099 3.77 5.90 4.50
starlette 0.14.2 14076 3.66 5.90 4.51
fastapi 0.65.1 9867 5.02 8.74 6.45
sanic 21.3.4 9238 5.39 9.10 6.94
aiohttp 3.7.4.post0 7755 8.27 8.32 8.26
quart 0.15.1 3551 18.48 19.17 18.00
tornado 6.1 3420 18.69 18.80 18.71
django 3.2.3 1875 33.95 37.66 34.16

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.6 6252 7.82 13.82 10.25
muffin 0.78.0 4799 10.21 17.96 13.30
sanic 21.3.4 4477 10.94 19.30 14.27
falcon 3.0.1 3800 13.39 22.29 16.94
starlette 0.14.2 2627 29.69 31.85 24.31
aiohttp 3.7.4.post0 2427 26.34 26.43 26.36
fastapi 0.65.1 2312 21.44 37.78 27.63
tornado 6.1 2309 27.67 27.81 27.70
quart 0.15.1 1911 33.31 33.86 33.48
emmett 2.2.1 1603 36.73 45.41 39.88
django 3.2.3 1026 62.15 69.63 62.28

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.6 11063 4.55 7.57 5.75
muffin 0.78.0 10616 4.65 8.04 6.00
falcon 3.0.1 10215 4.88 8.44 6.23
starlette 0.14.2 8166 6.08 10.54 7.80
sanic 21.3.4 7791 6.31 10.83 8.22
emmett 2.2.1 7425 6.68 11.20 8.71
fastapi 0.65.1 6497 7.53 13.42 9.82
aiohttp 3.7.4.post0 4936 12.99 13.12 12.99
tornado 6.1 2953 21.63 21.74 21.67
quart 0.15.1 2213 28.42 28.91 28.90
django 3.2.3 1555 41.68 45.21 41.12

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.6 553635 5.06 8.51 6.41
muffin 0.78.0 490470 5.98 10.26 7.66
falcon 3.0.1 450315 7.19 11.97 9.04
starlette 0.14.2 373035 13.14 16.1 12.21
emmett 2.2.1 346905 15.73 20.84 17.7
sanic 21.3.4 322590 7.55 13.08 9.81
fastapi 0.65.1 280140 11.33 19.98 14.63
aiohttp 3.7.4.post0 226770 15.87 15.96 15.87
tornado 6.1 130230 22.66 22.78 22.69
quart 0.15.1 115125 26.74 27.31 26.79
django 3.2.3 66840 45.93 50.83 45.85