Skip to content

Very poor performance does not align with marketing #1664

@ghost

Description

I wanted to check the temperature of this project and so I ran a quick, very simple, benchmark with wrk and the default example:

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
    return {"Hello": "World"}

Everything default with wrk, regular Ubuntu Linux, Python 3.8.2, latest FastAPI as of now.

wrk http://localhost:8000

Uvicorn with logging disabled (obviously), as per the README:

python3 -m uvicorn fast:app --log-level critical

I get very poor performance, way worse than Node.js and really, really far from Golang:

Running 10s test @ http://localhost:8000
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.83ms  365.59us   3.90ms   75.34%
    Req/Sec     2.74k   116.21     2.98k    65.00%
  54447 requests in 10.00s, 7.37MB read
Requests/sec:   5442.89
Transfer/sec:    754.78KB

This machine can do 400k req/sec on one single thread using other software, so 5k is not at all fast. Even Node.js does 20-30k on this machine, so this does not align at all with the README:

The key features are:

Fast: Very high performance, on par with NodeJS and Go (thanks to Starlette and Pydantic). One of the fastest Python frameworks available.

Where do you post benchmarks? How did you come to that conclusion? I cannot see you have posted any benchmarks at all?

Please fix marketing, it is not at all true.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions