Python web framework comparison: any two, head to head
sanic is quicker than aiohttp on 6 of the 9 profiles they both run, and behind on 2. On the HTTP/1.1 composite they score 2072 and 1630.
Pick any two of the 16 Python entries. Requests per second is the best of three runs and the delta is the first column against the second; every row is the same profile at the same connection count, on the same machine. What each profile measures.
| Profile | Conns | aiohttp req/sec | sanic req/sec | Delta | aiohttp p99 | sanic p99 |
|---|---|---|---|---|---|---|
| Baseline | 4,096 | 590,654 | 611,737 | -3% | 13.00ms | 6.42ms |
| Pipelined | 4,096 | 1,071,731 | 1,372,143 | -22% | 114.60ms | 50.70ms |
| Short-lived | 4,096 | 506,608 | 523,366 | -3% | 129.90ms | 5.10ms |
| Async Delay | 32,000 | 538,785 | 684,066 | -21% | 69.00ms | 47.90ms |
| Latency-10K | 1,024 | 9,982 | 9,982 | +0% | 287.0us | 305.0us |
| Latency-1M | 1,024 | 645,022 | 638,771 | +1% | 10342400.0us | 10530816.0us |
| Latency-500K/8 | 1,024 | 102,971 | 95,973 | +7% | 15839232.0us | 15314944.0us |
| JSON Comp | 4,096 | 101,899 | 172,836 | -41% | 249.60ms | 33.20ms |
| JSON Comp | 16,384 | 99,450 | 169,305 | -41% | 2.77s | 95.10ms |
Common comparisons
aiohttp vs sanic · aiohttp vs starlette · aiohttp vs litestar · sanic vs starlette · sanic vs litestar · starlette vs litestar
Questions
Is aiohttp faster than sanic?
sanic is quicker than aiohttp on 6 of the 9 profiles they both run, and behind on 2. On the HTTP/1.1 composite they score 2072 and 1630. Both run on the same machine, in the same round, against the same profiles.
Is aiohttp faster than starlette?
aiohttp is quicker than starlette on 10 of the 13 profiles they both run, and behind on 3. On the HTTP/1.1 composite they score 2072 and 1623. Both run on the same machine, in the same round, against the same profiles.
Is aiohttp faster than litestar?
aiohttp is quicker than litestar on 9 of the 13 profiles they both run, and behind on 3. On the HTTP/1.1 composite they score 2072 and 1504. Both run on the same machine, in the same round, against the same profiles.
Is sanic faster than starlette?
sanic is quicker than starlette on 9 of the 9 profiles they both run. On the HTTP/1.1 composite they score 1630 and 1623. Both run on the same machine, in the same round, against the same profiles.
Which Python framework is fastest overall?
fastpysgi-wsgi holds the highest HTTP/1.1 composite of the Python entries, at 3148. The composite is throughput over the whole suite; if a service is one shape of workload, compare that profile on its own in the table above, because the order changes.
Every Python entry
- fastpysgi-wsgi
- pyronova
- mq-bridge-py
- aiohttp
- blackbull
- sanic
- starlette
- uvicorn
- litestar
- fastpysgi-asgi
- fastapi
- robyn
- slimeweb
- flask
- bottle
- django
Results updated · Python composite ranking · Compare across languages · Other languages · Open the leaderboard