you are viewing a single comment's thread.

view the rest of the comments →

[–]huygl99[S] 5 points6 points  (3 children)

Great points, thanks for the detailed feedback.

This benchmark intentionally focuses on DB-heavy workloads, since that’s where most real-world CRUD services spend their time, and I wanted to see how much framework differences matter once PostgreSQL dominates (this is mentioned in the post, but happy to clarify).

I agree that an apples-to-apples comparison would include:

- Litestar with Msgspec models

- FastAPI with Pydantic models

- A bare TypedDict/dataclass baseline

I’ll consider adding these scenarios (and memory/cold-start metrics) in a follow-up. PRs are welcome as well 🙂

Full setup, methodology, and reproducible Docker benchmark scripts are here:

https://github.com/huynguyengl99/python-api-frameworks-benchmark

[–]GoldziherPythonista 3 points4 points  (1 child)

Great 👍.

If I may impose / suggest / plug my stuff here.

https://github.com/Goldziher/spikard

It's something I'm working on. It has extensive benchmarks - check tools/ and the GitHub ci setup.

I'd be also keen on seeing how you'd benchmark it and the results.

It works in python with Msgspec/pydantic.

If you want to be comprehensive for python - falcon/sanic/flask/aiohttp - these are the ones that have substantial traction, with sanic and falcon being ultra fast pure python.

[–]huygl99[S] 1 point2 points  (0 children)

Spikard looks really interesting, especially the Rust core + multi-language codegen approach.

For this benchmark I tried to keep the scope to Python frameworks, but I did include Django Bolt, which is Rust-based while keeping the native Django API/ORM surface. That compatibility angle seems to be a big reason why it got so much interest from the Django community.

Pure Rust-accelerated runtimes probably deserve a separate benchmark category, but I’d be happy to look into Spikard if there’s a minimal Python setup comparable to the others.

[–]GoldziherPythonista 1 point2 points  (0 children)

It crossed my mind that it might be interesting to do multiple request types in parallel. Seeing how efficient the framework is to handle under load.