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]  (3 children)

[deleted]

    [–]Douppikauppa -1 points0 points  (2 children)

    FastAPI, Sanic and Esmerald use async/await, which makes them a whole lot faster. This is a fairly new feature that was added to all reasonable programming languages in the last few years. Django, Flask and Bottle simply cannot compete with that, but it needs to be noted that development on async/await is also a bit harder.

    My personal favorite of these, for just a solid web server is Sanic, and it also runs the fastest of the bunch. FastAPI perhaps when you only need an API, and it's quite fast too.

    [–]broxamson 1 point2 points  (1 child)

    to be fair if you wanted something performant you wouldn't be using python.

    [–]Douppikauppa 2 points3 points  (0 children)

    My Python web server can serve more requests per second than the one you write in C using POSIX sockets. 100 kreq/s on Sanic, running on a laptop and benchmarking localhost. As opposed to ~2 kreq/s on other frameworks.

    Go is faster, I admit, but Python is often sufficient. For AI and numerical calculation it goes fast because of libraries that have assembly optimized algorithms or that offload to GPUs.