FastAPI हा Python frameworks पैकी सर्वात वेगवान आहे कारण तो Starlette (हलके वजनाचे ASGI framework) वर बनविलेला आहे आणि async-native आहे, अनेक एकाच वेळी I/O-bound विनंत्या कार्यक्षमतेने संभाळतो. परंतु त्याला वेग राखण्यासाठी async योग्यरित्या वापरणे आवश्यक आहे — सर्वात सामान्य चूक म्हणजे 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 मॉडेल हा मुख्य गोष्ट आहे: एक विनंती डेटाबेस क्वेरी किंवा API कॉलच्या प्रतीक्षेत असताना, सर्व्हर इतर संभाळतो — I/O-bound workloads साठी उच्च throughput देतो.
