news 2026-11-11 5 min 904 views

Benchmark: Starlette TestClient vs httpx ASGITransport

Operational notes on benchmarks: what to pin, what to smoke, what to ignore.

benchmarksfastapi

What changed

Benchmark: Starlette TestClient vs httpx ASGITransport is the short version. The parts that actually break production are below.

Practical notes

  • Pin the dependency in lockfiles before rolling fleet-wide.
  • Re-run your smoke against /docs and one authenticated route.
  • Watch p99 for 15 minutes after deploy; mean latency lies.
from fastapi import FastAPI

app = FastAPI()

@app.get("/health")
def health():
    return {"ok": True, "tag": "benchmarks"}

Caveats

Do not treat changelog marketing as a migration guide. Diff the release against your current pin and only upgrade when the smoke list is green.

Related