FastAPI سب سے تیز Python frameworks میں سے ایک ہے کیونکہ یہ Starlette (ایک ہلکا ASGI framework) پر بنایا گیا ہے اور async-native ہے، بہت سی بیک وقت I/O-bound requests کو موثر طریقے سے سنبھالتا ہے۔ لیکن اسے تیز رکھنے کے لیے async کو صحیح طریقے سے استعمال کرنا ضروری ہے — سب سے عام غلطی event loop کو block کرنا ہے۔
یہ تیز کیوں ہے
✓ 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 model کلید ہے: جب ایک request ڈیٹا بیس query یا API call کا انتظار کر رہا ہو، سرور دوسری کو سنبھالتا ہے — I/O-bound workloads کے لیے اعلیٰ throughput دیتا ہے۔
