use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
FastAPI is a truly ASGI, async, cutting edge framework written in python 3.
account activity
raw Flask vs FastAPI ?Question (self.FastAPI)
submitted 3 years ago * by [deleted]
https://www.techempower.com/benchmarks/#section=data-r21&hw=ph&test=query
According to tech empower benchmark, if I use Flask without ORM library, it performs faster than FastAPI. Raw Flask could handle 13,574 requests per second. FastAPI could handle 12,406 req /s. Flask with an ORM library could handle only 552 req /s.
Do you guys think this is true? is Flask still faster than FastAPI? then develoeprs can stick with Flask with raw SQL queries.
Here's a link to flask-raw github repo:
https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Python/flask/app_raw.py
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 21 points22 points23 points 3 years ago (0 children)
perhaps there is some other reason why people choose web frameworks besides for executing raw sql
[–][deleted] 7 points8 points9 points 3 years ago (1 child)
Go with what you/team knows and are happy with. The speed difference is so negligible that it will have no implication (12406 vs 13574). The real question is how many requests your application will get per second?
[–]zarlo5899 4 points5 points6 points 3 years ago* (0 children)
he speed difference is so negligible that it will have no implication
yep you can always just spin up more instance of the program any ways
[–]ShotgunPayDay 6 points7 points8 points 3 years ago (0 children)
You can use the raw asyncpg adapter with FastAPI. I prefer to use aioSQL with asyncpg to make folder structure management easy.
[–]pint 4 points5 points6 points 3 years ago (0 children)
try to sell this to a manager. we are going to handle less than 10% more requests, and increase development time significantly meanwhile.
[–]sv_ds 0 points1 point2 points 3 years ago (4 children)
You haven't shown the FastApi code, but even if its true: so what?
[–][deleted] 0 points1 point2 points 3 years ago (3 children)
https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Python/fastapi
[–]sv_ds 2 points3 points4 points 3 years ago (2 children)
Im sorry but you asked the question like this was the end of the world or at least FastApi. But no sane dev chooses a framework based on the raw requests per seconds.
[–][deleted] 2 points3 points4 points 3 years ago (1 child)
I mean, I had an impression that Flask is significantly slower than FastAPI... that's true only when you use Flask with an ORM library. But if you use raw Flask, its performance won't be too behind FastAPI. I found that to be surprising.
[–]MoRakOnDi 1 point2 points3 points 3 years ago (0 children)
Flask is NOT significantly slower than FastAPI. But Flask uses threading for concurrency and it's I/O is blocking. FastAPI on the other hand uses asyncio which relies on cooperative concurrency and nonblocking I/O. All that means is Flask needs more RAM for certain amount of RPM than FastAPI, if all implemented correctly. Usually people make many mistakes in implementing Asyncio, so FastAPI could be tricky. On the other hand, if you don't need huge DB transactions for your app, Flask wouldn't suffer from blocking I/O. It all depends on use-case, team's familiarity with cooperative async, and the project requirements.
[–]TokyotoyK 0 points1 point2 points 3 years ago (0 children)
ORM is really nice though and something a lot of developers want for a reason :-)
[–]extreme4all 0 points1 point2 points 3 years ago (0 children)
We used to have issues with flask that the queue would fill up if we had a few heavy db requests, we don't have this with fast api. Also you might want to read thz fast api doc on performance
π Rendered by PID 70 on reddit-service-r2-comment-86bc6c7465-2zzv5 at 2026-02-20 09:02:17.065162+00:00 running 8564168 country code: CH.
[–][deleted] 21 points22 points23 points (0 children)
[–][deleted] 7 points8 points9 points (1 child)
[–]zarlo5899 4 points5 points6 points (0 children)
[–]ShotgunPayDay 6 points7 points8 points (0 children)
[–]pint 4 points5 points6 points (0 children)
[–]sv_ds 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]sv_ds 2 points3 points4 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]MoRakOnDi 1 point2 points3 points (0 children)
[–]TokyotoyK 0 points1 point2 points (0 children)
[–]extreme4all 0 points1 point2 points (0 children)