leavers / framework-benchmarks

Benchmarks of some Python web frameworks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Framework Benchmarks

This project aims to perform performance tests on several common Python web frameworks and server deployment solutions, so as to have a more concrete understanding of the differences between different combinations.

There are currently three test items: a simple "Hello World" interface, querying data from a PostgreSQL database, and returning results after matrix operations based on scipy/numpy.

Frameworks I tested:

  • bottle
  • falcon
  • fastapi
  • flask
  • sanic
  • starlette

Some conclusions based on my "rough" experiments:

  1. Falcon (WSGI) + CPython + Meinheld performs much better than others on my PC;
  2. Meinheld brings WSGI comparable (or even better) performance improvements to ASGI in IO tasks;
  3. PyPy is comparable with CPython + gevent or meinheld, and better than bare CPython.

About

Benchmarks of some Python web frameworks


Languages

Language:Python 70.9%Language:Dockerfile 16.5%Language:Shell 12.6%