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.
References
[1] The birth of the Web. CERN, https://home.cern/science/computing/birth-web, [10.01.2025].
[2] R. A. Santelices, M. Nussbaum, A framework for the development of videogames, Software Practice and Experience 31 (2001) 1091-1107, https://doi.org/10.1002/spe.403.
[3] Stack Overflow Developer Survey 2023, https://survey.stackoverflow.co/2023/#technology-most-popular-technologies, [11.05.2025].
[4] W. W. Eckerson, Three tier client/server architectures: Achieving scalability, performance, and efficiency in client server applications, Open Information Systems 10 (1995) 46-50.
[5] J. Kopecky, P. Fremantle, R. Boakes, A history and future of Web APIs, it - Information Technology 56(3) (2014) 90-97, https://doi.org/10.1515/itit-2013-1035.
[6] Pillars of Python: Six Python Web frameworks compared, https://www.infoworld.com/article/2273961/pillars-of-python-six-python-web-frameworks-compared-2.html, [11.05.2025].
[7] F. Fuior, Introduction in Python frameworks for web development, Romanian Journal of Information Technology and Automatic Control 31(3) (2021) 97–108, https://doi.org/10.33436/v31i3y202108.
[8] D. Ghimire, Comparative study on Python web frameworks: Flask and Django, Bachelor thesis, Metropolia University of Applied Sciences, Helsinki, 2020.
[9] A. Pankiv, Concurrent benchmark system for web-frameworks on Python, Bachelor thesis, Ukrainian Catholic University, Lviv, 2019.
[10] V. Apte, T. Hansen, P. Reeser, Performance comparison of dynamic web platforms, Computer Communications 26(8) (2003) 888-898, https://doi.org/10.1016/s0140-3664(02)00221-9.
[11] L. N. Hyseni, A. Dermaku, Z. Dika, Evaluating Web Frameworks for Personal Learning Decision-Making: A Comparative Analysis, International Journal of Computational and Experimental Science and Engineering 11(2) (2025) 3365-3374, https://doi.org/10.22399/ijcesen.1845.
[12] Welcome to Flask - Flask Documentation, https://flask.palletsprojects.com/en/stable/, [11.05.2025].
[13] The web framework for perfectionist with deadlines, Django, https://www.djangoproject.com, [11.05.2025].
[14] Home - Django REST Framework, https://www.django-rest-framework.org, [11.05.2025].
[15] FastAPI, https://fastapi.tiangolo.com, [11.05.2025].
[16] sqlite3 - DB-API 2.0 interface for SQLite databases, https://docs.python.org/3/library/sqlite3.html, [11.05.2025].