Python web framework comparison: any two, head to head
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 2044 and 1604.
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 | starlette req/sec | Delta | aiohttp p99 | starlette p99 |
|---|---|---|---|---|---|---|
| Baseline | 4,096 | 590,654 | 399,413 | +48% | 13.00ms | 14.50ms |
| Pipelined | 4,096 | 1,071,731 | 487,988 | +120% | 114.60ms | 220.60ms |
| Short-lived | 4,096 | 506,608 | 361,088 | +40% | 129.90ms | 60.00ms |
| Async Delay | 32,000 | 538,785 | 315,041 | +71% | 69.00ms | 234.40ms |
| Latency-10K | 1,024 | 9,982 | 9,980 | +0% | 287.0us | 461.0us |
| Latency-1M | 1,024 | 645,022 | 410,755 | +57% | 10342400.0us | 13242368.0us |
| Latency-500K/8 | 1,024 | 102,971 | 62,708 | +64% | 15839232.0us | 17276928.0us |
| JSON Comp | 4,096 | 101,899 | 130,650 | -22% | 249.60ms | 415.30ms |
| JSON Comp | 16,384 | 99,450 | 126,853 | -22% | 2.77s | 700.80ms |
| JSON TLS | 4,096 | 240,408 | 185,089 | +30% | 103.00ms | 219.31ms |
| 8Gbit | 512 | 49,381 | 49,387 | -0% | 434.0us | 769.0us |
| Static TLS | 1,024 | 82,563 | 22,998 | +259% | 47.21ms | 263.52ms |
| Async DB | 1,024 | 102,119 | 88,740 | +15% | 52.20ms | 79.90ms |
Common comparisons
aiohttp vs starlette · aiohttp vs sanic · aiohttp vs litestar · starlette vs sanic · starlette vs litestar · sanic vs litestar
Questions
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 2044 and 1604. Both run on the same machine, in the same round, against the same profiles.
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 2044 and 1602. 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 2044 and 1487. Both run on the same machine, in the same round, against the same profiles.
Is starlette faster than sanic?
sanic is quicker than starlette on 9 of the 9 profiles they both run. On the HTTP/1.1 composite they score 1604 and 1602. 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
- starlette
- sanic
- uvicorn
- litestar
- fastpysgi-asgi
- fastapi
- robyn
- slimeweb
- flask
- bottle
- django
Results updated · Python composite ranking · Compare across languages · Other languages · Open the leaderboard