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.4 19306 2.78 4.24 3.28
muffin 0.70.1 17047 3.11 4.84 3.72
falcon 3.0.0 15739 3.29 5.27 4.03
starlette 0.14.2 14155 3.78 5.87 4.48
emmett 2.2.1 13995 3.65 5.96 4.54
fastapi 0.65.0 9943 5.02 8.52 6.40
sanic 21.3.4 9188 5.51 9.03 6.99
aiohttp 3.7.4.post0 7945 8.04 8.11 8.07
quart 0.14.1 3742 17.45 18.37 17.12
tornado 6.1 3460 18.46 18.64 18.49
django 3.2.2 1825 33.30 38.98 35.04

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.4 6164 8.07 14.17 10.35
muffin 0.70.1 4658 10.57 18.87 13.76
sanic 21.3.4 4368 11.24 19.77 14.68
falcon 3.0.0 3732 13.60 22.97 17.25
starlette 0.14.2 2546 19.36 34.32 25.10
aiohttp 3.7.4.post0 2377 26.87 27.29 26.91
tornado 6.1 2273 28.07 28.47 28.16
fastapi 0.65.0 2262 21.81 38.68 28.23
emmett 2.2.1 1545 38.23 46.56 41.41
quart 0.14.1 1417 45.18 46.87 45.14
django 3.2.2 988 62.76 71.94 64.68

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.4 11018 4.55 7.71 5.77
falcon 3.0.0 10317 4.83 8.27 6.17
muffin 0.70.1 10139 4.88 8.39 6.28
starlette 0.14.2 8238 6.04 10.40 7.73
sanic 21.3.4 7728 6.41 10.87 8.29
emmett 2.2.1 7202 6.76 11.83 9.04
fastapi 0.65.0 6319 7.79 13.65 10.09
aiohttp 3.7.4.post0 4654 13.76 14.04 13.75
tornado 6.1 2913 21.90 22.23 21.97
quart 0.14.1 2422 25.98 26.79 26.41
django 3.2.2 1516 41.35 46.52 42.15

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.4 547320 5.13 8.71 6.47
muffin 0.70.1 477660 6.19 10.7 7.92
falcon 3.0.0 446820 7.24 12.17 9.15
starlette 0.14.2 374085 9.73 16.86 12.44
emmett 2.2.1 341130 16.21 21.45 18.33
sanic 21.3.4 319260 7.72 13.22 9.99
fastapi 0.65.0 277860 11.54 20.28 14.91
aiohttp 3.7.4.post0 224640 16.22 16.48 16.24
tornado 6.1 129690 22.81 23.11 22.87
quart 0.14.1 113715 29.54 30.68 29.56
django 3.2.2 64935 45.8 52.48 47.29