Implementation

FastAPI

FastAPI 0.163.0 · Python · Popular references · ranked

frameworks/fastapi on GitHub

Scores

Score relative to Axum (1.00×, higher is better) and position among the 14 ranked implementations; Stability: pass.
CategoryPositionScore±
Hello world110.073*±28.9%
Database11–130.20*±27.5%
Application11–130.11*±16.4%
Memory (high-water mark)110.34±2.6%
Startup1–130.75±23.1%

Runner CPUs: EPYC 9V74, EPYC 9V45, EPYC 9V74

Settings

Runtime
CPython 3.14.10
Server
Uvicorn 0.54 (uvloop, httptools)
Workers
BENCH_WORKERS Uvicorn worker processes (2), one event loop each
Database layer
SQLModel 0.0.50 on SQLAlchemy 2.1 with psycopg 3 (sync sessions, as in the FastAPI SQL tutorial), DB_POOL_SIZE / BENCH_WORKERS connections per process
Templates
Jinja2 3.1 (Jinja2Templates)
Logging
none (Uvicorn --no-access-log)
Dependency source
–
Status
measured

Notes

Application endpoints: mechanisms

Validation
Path and query parameter types, a Query() parameter model, a Pydantic body model (StrictInt) and a Form() model: 422
CSRF
token (documented): asgi-csrf 0.11 (signed double-submit csrftoken cookie and form field; 403), on the mounted browser sub-application
Session store
cookie-signed (documented): Starlette SessionMiddleware (itsdangerous-signed cookie holding the user id), on the mounted browser sub-application; pwdlib Argon2 on users.password_argon2id

Tier 1 endpoints

Medians over every round (lowest and highest round in brackets); vs Axum: the median of the per-round ratios on the same runners.
Endpointreq/svs AxumEfficiency (req/CPU-s)p99 (ms)ErrorsLimits
/text13,475 (10,458–21,379)0.086,7409.790
/json12,587 (9,751–20,126)0.086,29810.540
/db-single1,884 (1,469–2,744)0.10952124.180
/html10,123 (7,811–15,552)0.065,06313.000
/queries?queries=20257 (199–347)0.23129779.890
/fortunes1,959 (1,526–2,640)0.07986129.690
GET /world/{id}1,909 (1,504–2,634)0.11965124.780
GET /worlds1,355 (1,079–1,876)0.10684174.870
POST /form4,078 (3,167–5,600)0.052,050177.640
GET /me1,583 (1,260–2,166)0.17796150.830
/updates?queries=20133 (103–171)0.27661,516.280
PUT /world/{id}1,317 (1,017–1,707)0.09666185.520

Measured versions

Runner jobs

Each job ran on its own GitHub-hosted runner; the CPU model differs between jobs.
JobCPU modelRoundsStatus
1EPYC 9V745measured
2EPYC 9V455measured
3EPYC 9V745measured