Skip to content

Commit 49eae1e

Browse files
committed
Add FastAPI Starkit benchmark
Add a Python benchmark for the FastAPI Starkit framework under python/fastapi_starkit, mirroring the existing fastapi implementation. It provides the standard benchmark routes via an APIRouter and is registered in reviewers.yaml so the suite picks it up.
1 parent 11096b8 commit 49eae1e

4 files changed

Lines changed: 44 additions & 0 deletions

File tree

python/fastapi_starkit/config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
framework:
2+
website: fastapi.tiangolo.com
3+
version: 0.139
4+
5+
engines:
6+
- uvicorn
7+
- hypercorn
8+
- daphne
9+
- granian
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
[build-system]
3+
build-backend = "flit_core.buildapi"
4+
requires = ["flit_core"]
5+
6+
[project]
7+
name = 'server'
8+
version = '1.0.0'
9+
description = "Simple benchmark implementation"
10+
dependencies = ["fastapi>=0.139,<0.140"]

python/fastapi_starkit/server.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from fastapi import APIRouter, FastAPI
2+
from starlette.responses import PlainTextResponse
3+
4+
router = APIRouter()
5+
6+
7+
@router.get("/")
8+
async def index():
9+
return PlainTextResponse(content="")
10+
11+
12+
@router.get("/user/{id}")
13+
async def get_user(id: int):
14+
return PlainTextResponse(content=f"{id}".encode())
15+
16+
17+
@router.post("/user")
18+
async def create_user():
19+
return PlainTextResponse(content="")
20+
21+
22+
app = FastAPI()
23+
app.include_router(router)

reviewers.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ python:
7070
- ahopkins
7171
fastapi:
7272
- tiangolo
73+
fastapi_starkit:
74+
- tiangolo
7375
tonberry:
7476
- Ayehavgunne
7577
asgineer:

0 commit comments

Comments
 (0)