Benchmarking the performance of Python web frameworks

Main Article Content

DOI

Bartłomiej Bednarz

s90866@pollub.edu.pl

https://orcid.org/0009-0006-1621-1701
Marek Miłosz

m.milosz@pollub.pl

https://orcid.org/0000-0002-5898-815X

Abstract


This article presents a comparative performance analysis of three the most popular Python web frameworks - Django (with Django Rest Framework), Flask, and FastAPI - in the context of developing Web APIs. The evaluation focused on key performance metrics such as request throughput for basic GET and POST operations, and response times for database-related CRUD operations. FastAPI consistently outperforms the other frameworks in most scenarios. The study also highlights how ORM usage can incur performance costs, even outside database use. A notable outlier was found in FastAPI when using SQLModel for large-scale data retrieval. Overall, the findings provide practical insights that can assist developers in selecting the most suitable framework.


Keywords:

benchmarking, performance, Flask, Django Rest Framework, FastAPI, sqlite, crud

References

Article Details

Bednarz, B., & Miłosz, M. (2025). Benchmarking the performance of Python web frameworks. Journal of Computer Sciences Institute, 36, 336–341. https://doi.org/10.35784/jcsi.7738