Implementation
FastAPI
FastAPI 0.163.0 · Python · Popular references · ranked
Scores
| Category | Position | Score | ± |
|---|---|---|---|
| Hello world | 11 | 0.073* | ±28.9% |
| Database | 11–13 | 0.20* | ±27.5% |
| Application | 11–13 | 0.11* | ±16.4% |
| Memory (high-water mark) | 11 | 0.34 | ±2.6% |
| Startup | 1–13 | 0.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
- Structure: Python 3.14.10, as in FastAPI's container guide (Django runs 3.15.2)
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
| Endpoint | req/s | vs Axum | Efficiency (req/CPU-s) | p99 (ms) | Errors | Limits |
|---|---|---|---|---|---|---|
| /text | 13,475 (10,458–21,379) | 0.08 | 6,740 | 9.79 | 0 | |
| /json | 12,587 (9,751–20,126) | 0.08 | 6,298 | 10.54 | 0 | |
| /db-single | 1,884 (1,469–2,744) | 0.10 | 952 | 124.18 | 0 | |
| /html | 10,123 (7,811–15,552) | 0.06 | 5,063 | 13.00 | 0 | |
| /queries?queries=20 | 257 (199–347) | 0.23 | 129 | 779.89 | 0 | |
| /fortunes | 1,959 (1,526–2,640) | 0.07 | 986 | 129.69 | 0 | |
| GET /world/{id} | 1,909 (1,504–2,634) | 0.11 | 965 | 124.78 | 0 | |
| GET /worlds | 1,355 (1,079–1,876) | 0.10 | 684 | 174.87 | 0 | |
| POST /form | 4,078 (3,167–5,600) | 0.05 | 2,050 | 177.64 | 0 | |
| GET /me | 1,583 (1,260–2,166) | 0.17 | 796 | 150.83 | 0 | |
| /updates?queries=20 | 133 (103–171) | 0.27 | 66 | 1,516.28 | 0 | |
| PUT /world/{id} | 1,317 (1,017–1,707) | 0.09 | 666 | 185.52 | 0 |
Measured versions
argon2-cffi25.1.0asgi-csrf0.11fastapi0.163.0httptools0.9.0itsdangerous2.2.0jinja23.1.6psycopg3.3.9psycopg-binary3.3.9pwdlib0.4.2pydantic2.14.3python3.14.10python-multipart0.0.34sqlalchemy2.1.8sqlmodel0.0.50starlette1.10.0uvicorn0.54.0uvloop0.23.0
Runner jobs
| Job | CPU model | Rounds | Status |
|---|---|---|---|
| 1 | EPYC 9V74 | 5 | measured |
| 2 | EPYC 9V45 | 5 | measured |
| 3 | EPYC 9V74 | 5 | measured |