Travis Luong wanted to verify FastAPI’s claims of having performance on par with Node.js. For this, I used wrk, an HTTP benchmarking tool. I also wanted to test it with a call to an endpoint that makes a call. to a Postgres database in order to simulate a more ‘realistic’ scenario.
Table of contents
FastAPI vs. Express.js vs. Flask vs. Nest.js BenchmarkFastAPI + psycopg2 + uvicornFastAPI + SQLModel + uvicornFlask + psycopg2 + flask runFlask + psycopg2 + gunicorn (1 worker)Express.js + pgNest.js + PrismaFlask + psycopg2 + gunicorn (4 workers)FastAPI + psycopg2 + gunicorn (4 workers)FastAPI + SQLModel + gunicorn (4 workers)Conclusion2 Comments
Sort: