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!
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.
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.
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).