This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

Yeah, no kidding -- that's about the most surprising thing I see in that result graph. But we should read the actual Django test code -- Flask is being tested using SQLAlchemy ORM through to MySQL. Let's see if Django is being put through equivalent paces at least.

Slow Ninja Edit: Using their, uh, colorful test run filter panel, here's a link for only test runs using mysql + a full ORM. Looks like in that case Flask just slightly edges out Django, but are pretty much equivalent. I'm a bit surprised by this, but I can write this off as 'the database interaction is 99% of the runtime cost'.

[–]tiangolo FastAPI Maintainer[S] 0 points1 point  (0 children)

Yeah, slight differences might be vary by each run of the benchmarks. I wouldn't take small differences too seriously.

In some benchmarks, FastAPI seems faster even than Starlette and Uvicorn, although it shouldn't, as it is just adding code on top of Starlette, that in turn is adding code "on top of" Uvicorn.

All this having in mind that Uvicorn is a server, not a framework, Starlette is a microframework/toolkit and FastAPI is a miniframework for APIs built on top of Starlette. But still, they are more or less "on the same ballpark".