zagrajmy / adr

architectural decision records
0 stars 0 forks source link

Choose best Python async framework #2

Closed radekjg closed 4 years ago

radekjg commented 4 years ago

Starlette is fastest (except bare asyncio on uvicorn, which doesn't support much http stuff).

Performance benchmark (requests/second)


OLD: On backend site we could use aiohttp on gunicorn with uvloop workers. uvloop is the fastest async loop for Python.

Discarded alternatives (all are similarily fast)

Sanic

No real issues here. It is also based on uvloop. I just don't like flask and Sanic is basically an async version of flask. I could go with sanic as well.

Uvicorn

It's more like a server worker than actual framework. Works very fast with asyncio, but doesn't work with aiohttp, and web frameworks built on top of uvicorn are slower than aiohttp on uvloop.

radekjg commented 4 years ago

Experimental implementation: https://github.com/zagrajmy/backend