Hacker News new | past | comments | ask | show | jobs | submit login

Well FastAPI was originally based on pydantic 1.x, which was extremely slow (so slow in fact that they removed the benchmarks from the website).

I am the author of typedload, a similar library written in pure python.

Mostly for fun I started to see how much I could improve performances, benchmarking against other libraries.

I was very surprised to find out that pydantic2, despite the rewrite in rust, wasn't overwhelmingly faster… in fact it is still slower than my pure python library in some cases.

But, I guess having "fast" in the name sounds good!

https://ltworf.github.io/typedload/performance.html (I re-run them every time I release).




I am certainly not in love with how the FastAPI team handles comparisons or development. Hiding superior benchmarks. Immediately closing Github issues (they refile as Discussions to keep the issue count low). So on and so forth.


I suspect that part of the problem is that they got VC money to do the rewrite in rust, and it took very long and the results aren't as amazing as expected.

But that's just my own conspiracy. I have no idea. Perhaps things changed since I last ran the benchmarks.

Benchmarking isn't easy. I know that my software using my library mostly loads Unions, so that's a focus in my benchmarks. However I have absolutely no idea of what the other users are doing with it, and my benchmarks might not be relevant to them.

In the end I wrote them for myself mostly, to check for possible regressions in performances.


The Pydantic project has a long history of misrepresenting their benchmarks, and ignoring the existence of much faster alternatives. I'm not at all surprised that their supposedly super-fast rewrite isn't really as fast as they made it out to be.


Fast for me was about the DX rather than performance.


What does dx mean?


Developer experience (developer happiness, speed of development)


Not the first time I see you try to use any thread related to pydantic or fastapi to market your own library, it’s getting boring.


I'm under the impression that you work for a company that sells services related to FastAPI? https://github.com/Intility/fastapi-azure-auth

I maintain an open source library in my spare time for free, that you are welcome to ignore if you find better alternatives.


You’re under the wrong impression, I’m a network engineer who happens to _use_ FastAPI for some projects. The library linked I made at work, but open sourced and wrote docs for in my own time. The other libraries I’ve written are all in my spare time.

My comment is my own opinion, and a quick search for your name and pydantic backs it up. It’s just boring to read the same thing, every time.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: