HttpArena
Comparisons

Python web framework comparison: any two, head to head

sanic is quicker than fastapi on 10 of the 12 profiles they both run, and behind on 2. On the HTTP/1.1 composite they score 190 and 161.

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. What each profile measures.

ProfileConnsfastapi req/secsanic req/secDeltafastapi p99sanic p99
Baseline512320,447593,133-46%3.24ms1.79ms
Baseline4,096314,605611,737-49%18.30ms6.42ms
Pipelined512364,4321,461,670-75%25.70ms11.00ms
Pipelined4,096359,8471,372,143-74%205.40ms50.70ms
Short-lived512284,181509,963-44%3.92ms2.12ms
Short-lived4,096286,820523,366-45%75.80ms5.10ms
JSON4,096157,204344,340-54%344.30ms16.00ms
JSON Comp51293,695172,278-46%12.20ms6.84ms
JSON Comp4,09693,953172,836-46%575.70ms33.20ms
JSON Comp16,38492,206169,305-46%803.70ms95.10ms
Upload322,1251,814+17%65.90ms80.40ms
Upload2561,5361,244+23%811.10ms1.07s

Common comparisons

fastapi vs sanic · fastapi vs litestar · fastapi vs starlette · sanic vs litestar · sanic vs starlette · litestar vs starlette

Questions

Is fastapi faster than sanic?

sanic is quicker than fastapi on 10 of the 12 profiles they both run, and behind on 2. On the HTTP/1.1 composite they score 190 and 161. Both run on the same machine, in the same round, against the same profiles.

Is fastapi faster than litestar?

litestar is quicker than fastapi on 11 of the 12 profiles they both run, and behind on 1. On the HTTP/1.1 composite they score 190 and 137. Both run on the same machine, in the same round, against the same profiles.

Is fastapi faster than starlette?

starlette is quicker than fastapi on 12 of the 12 profiles they both run. On the HTTP/1.1 composite they score 190 and 137. Both run on the same machine, in the same round, against the same profiles.

Is sanic faster than litestar?

sanic is quicker than litestar on 10 of the 12 profiles they both run, and behind on 2. On the HTTP/1.1 composite they score 161 and 137. Both run on the same machine, in the same round, against the same profiles.

Which Python framework is fastest overall?

pyronova holds the highest HTTP/1.1 composite of the Python entries, at 898. 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 · Other languages · Open the leaderboard