FastAPI เป็นหนึ่งใน framework ของ Python ที่เร็วที่สุดเพราะมันสร้างบน Starlette (ASGI framework ที่เบา) และเป็น async-native จัดการ request ที่เป็น I/O-bound จำนวนมากพร้อมกันได้อย่างมีประสิทธิภาพ แต่การรักษาความเร็วต้องใช้ async อย่างถูกต้อง — ความผิดพลาดที่พบบ่อยที่สุดคือการ block event loop
ทำไมมันถึงเร็ว
✓ 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
โมเดล async คือกุญแจสำคัญ: ขณะที่ request หนึ่ง await query ฐานข้อมูลหรือการเรียก API server จะจัดการตัวอื่น ๆ — ให้ throughput สูงสำหรับงานที่เป็น I/O-bound
