FastAPI è uno dei framework Python più veloci perché è costruito su Starlette (un framework ASGI leggero) ed è async-native, gestendo efficientemente molte richieste concorrenti I/O-bound. Ma mantenerlo veloce richiede di usare async correttamente — l'errore più comune è bloccare l'event loop.
Perché è veloce
✓ ASGI + Starlette — a modern async foundation (vs older WSGI sync frameworks)
✓ Async-native — one process handles thousands of concurrent I/O-bound requests
by overlapping wait times, instead of one-at-a-time
✓ Pydantic v2 — validation/serialization core is now in Rust (very fast)
✓ Minimal overhead per request
Il modello async è la chiave: mentre una richiesta attende una query sul database o una chiamata API, il server gestisce altre — garantendo alto throughput per carichi di lavoro I/O-bound.
