Earlier quoted context omitted.
BTW being ASGI is not excuse because ASGI spec (PEP 3333) have a section on how to expose and make use of sendfile kernel routine. https://peps.python.org/pep-3333/#optional-platform-specific...
You’re correct, sort of. But you’re not testing JUST FastAPI’s performance, you’re also testing Uvicorn’s. For them to be equivalent tests, both need the same run patterns. It’s closer to comparing Flask running as a script with flask running behind gunicorn as written and as I read it. And no, I’m not going to fix your benchmarks for you. This does not provide any value to me but does come at a time cost. I apprecia…
here I've eliminated uvicorn, nothing changed
https://gist.github.com/muayyad-alsadi/3a1e1cdbafca34df8b178...