Skip to content

Instantly share code, notes, and snippets.

@patx
Last active May 11, 2026 06:59
Show Gist options
  • Select an option

  • Save patx/39e846ed66bead3e42270ff193db35f8 to your computer and use it in GitHub Desktop.

Select an option

Save patx/39e846ed66bead3e42270ff193db35f8 to your computer and use it in GitHub Desktop.
Latest benchmarks for new MicroPie release (v0.29)

Benchmarking Python Web Frameworks: BlackSheep, Starlette, MicroPie, Quart, FastAPI

I created minimal apps for each framework, all returning {"Hello": "World"} as JSON. All frameworks were benchmarked using Granian in ASGI mode with 8 workers.

Benchmark command:

granian --interface asgi --workers 8 app:app

Load testing was performed with wrk against http://127.0.0.1:8000:

wrk -t4 -c1000 -d15s http://127.0.0.1:8000/

Framework Implementations

BlackSheep

from blacksheep import Application, get, json

app = Application()

@get("/")
async def home():
    return json({"Hello": "World"})

Starlette

from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route

async def homepage(request):
    return JSONResponse({"Hello": "World"})

app = Starlette(routes=[Route("/", homepage)])

MicroPie

from micropie import App

class Root(App):
    async def index(self):
        return {"Hello": "World"}

app = Root()

Quart

from quart import Quart

app = Quart(__name__)

@app.route("/")
async def greet():
    return {"Hello": "World"}

FastAPI

from fastapi import FastAPI

app = FastAPI()

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

Benchmark Results

Results ordered by highest Requests/sec:

Framework Requests/sec Avg Latency (ms) Max Latency (ms) Transfer/sec (MB) Total Requests Data Read (MB)
MicroPie 234244.46 4.04 53.62 30.62 3536707 462.36
BlackSheep 231688.13 4.04 82.57 30.21 3495372 455.76
Starlette 223883.45 4.24 76.26 29.22 3381117 441.35
FastAPI 150351.61 6.57 131.65 19.52 2270601 294.85
Quart 104469.09 11.75 197.47 13.41 1575417 202.18

Observations

MicroPie

MicroPie achieved the highest throughput in these tests at 234k requests/sec, while also maintaining excellent latency characteristics.

BlackSheep

BlackSheep continues to be one of the fastest Python ASGI frameworks available. Its json() helper is highly optimized and produces extremely low-overhead responses.

Starlette

Starlette remains an excellent low-level ASGI toolkit with very strong performance and minimal abstraction overhead.

FastAPI

FastAPI provides automatic validation, dependency injection, OpenAPI generation, and typing support. Those features add overhead compared to lower-level frameworks, but provide substantial developer productivity benefits.

Quart

Quart’s Flask-compatible API and higher-level abstractions make it easy to use, but significantly slower under this synthetic benchmark.

Key Takeaways

  1. MicroPie achieved the highest throughput in this benchmark at 234k req/sec while maintaining low latency.
  2. BlackSheep and Starlette remain extremely competitive, all three frameworks performing within a similar top-tier range.
  3. FastAPI trades raw throughput for developer tooling, validation, and API features.
  4. Quart prioritizes Flask compatibility and simplicity over raw speed.
  5. At this performance level, differences become increasingly influenced by:
    • HTTP parsing
    • socket scheduling
    • worker contention
    • runtime overhead
    • kernel/network limits

Conclusion

All tested frameworks performed well under heavy load, but the benchmark highlights how far modern Python ASGI frameworks have advanced.

MicroPie now performs in the same ultra-high-performance category as BlackSheep and Starlette while retaining a very minimal and ergonomic API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment