HttpArena

Python web framework comparison: any two, head to head

aiohttp is ahead of starlette on 9 of the 11 tests they both run, and behind on 2. On the HTTP/1.1 composite aiohttp scores 1447 and starlette 1082.

Pick any two of the 17 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. The fixed-rate profiles offer every entry the same request rate, so they are compared on their score out of 100 instead, which is CPU cost and latency at that rate. What each profile measures.

ProfileConnsaiohttpstarletteDeltaaiohttp p99starlette p99
Requests per second
Baseline4,096590,654399,413+48%13.00ms14.50ms
Pipelined4,0961,071,731487,988+120%114.60ms220.60ms
Short-lived4,096506,608361,088+40%129.90ms60.00ms
Async Delay32,000538,785315,041+71%69.00ms234.40ms
JSON Comp4,096101,899130,650-22%249.60ms415.30ms
JSON Comp16,38499,450126,853-22%2.77s700.80ms
JSON TLS4,096240,408185,089+30%103.00ms219.31ms
Static TLS1,02482,56322,998+259%47.21ms263.52ms
Fixed-rate profiles: score out of 100
Latency-10K1,02442.133.0+28%287us461us
Latency-1M1,0246.52.6+150%10.34s13.24s
8Gbit51244.735.5+26%434us769us

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 ahead of starlette on 9 of the 11 tests they both run, and behind on 2. On the HTTP/1.1 composite aiohttp scores 1447 and starlette 1082. Both run on the same machine, in the same round, against the same profiles.

Is aiohttp faster than sanic?

sanic is ahead of aiohttp on 6 of the 8 tests they both run, and behind on 2. On the HTTP/1.1 composite aiohttp scores 1447 and sanic 1018. Both run on the same machine, in the same round, against the same profiles.

Is aiohttp faster than litestar?

aiohttp is ahead of litestar on 9 of the 11 tests they both run, and behind on 2. On the HTTP/1.1 composite aiohttp scores 1447 and litestar 963. Both run on the same machine, in the same round, against the same profiles.

Is starlette faster than sanic?

sanic is ahead of starlette on 8 of the 8 tests they both run. On the HTTP/1.1 composite starlette scores 1082 and sanic 1018. Both run on the same machine, in the same round, against the same profiles.

Which Python framework is fastest overall?

Among the Python web frameworks, mq-bridge-py holds the highest HTTP/1.1 composite, at 1571; among the Python HTTP engines, fastpysgi-wsgi holds the highest HTTP/1.1 composite, at 2458; among the experimental Python frameworks, mipyre holds the highest HTTP/1.1 composite, at 3200. Each league is measured against its own leader, and the leagues do not all count the same profiles, so those numbers are not on one scale and the highest of them is not the fastest entry on the page: to set an entry of one league against an entry of another, pick the two in the table above. 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

Results updated · Python composite ranking · Compare across languages · Other languages · Open the leaderboard