FastAPI सबैभन्दा छिटो Python frameworks मध्ये एक हो किनभने यो Starlette (एक हल्का ASGI framework) मा निर्मित छ र async-native छ, धेरै समवर्ती I/O-bound requests लाई कुशलतापूर्वक सम्भाल्छ। तर यसलाई छिटो राख्नको लागि 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 मडेल कुञ्जी हो: जब एक request database query वा API call को प्रतीक्षा गरिरहेको हुन्छ, सर्भर अन्यलाई सम्भाल्छ — I/O-bound कार्यभारको लागि उच्च throughput दिन्छ।
