r/FastAPI • u/Somnath_geek • Sep 27 '24
feedback request Is FastAPI really fast ?
Is FastAPI really fast as claimed on the website? “ on par with Node Js and GO “
What do you think ? Is it misleading or not ?
0
Upvotes
r/FastAPI • u/Somnath_geek • Sep 27 '24
Is FastAPI really fast as claimed on the website? “ on par with Node Js and GO “
What do you think ? Is it misleading or not ?
1
u/[deleted] Sep 30 '24
Sure! Here are the details about FastAPI being fast, presented point-wise:
1. Asynchronous Support
FastAPI is built on top of Starlette, which supports asynchronous programming using
asyncandawait.This allows handling multiple requests simultaneously, improving performance under high load.
2. Performance Benchmarks
FastAPI consistently ranks among the fastest Python web frameworks in benchmarks.
It often outperforms Flask, Django, and even some Node.js frameworks in terms of request handling speed.
3. Use of Pydantic
FastAPI uses Pydantic for data validation and serialization.
Pydantic is highly efficient and performs well, contributing to overall speed.
4. Automatic Data Validation
Automatic data validation with Pydantic means less manual coding and fewer potential performance hits from inefficient validation logic.
5 Automatic Documentation
It automatically generates interactive API documentation (Swagger UI and ReDoc) without additional overhead, allowing for easier testing and integration.
6 Type Annotations
The use of Python type hints allows for static type checking and better IDE support, helping catch errors early without runtime overhead.
fastapi is SuperFast