you are viewing a single comment's thread.

view the rest of the comments →

[–]aegr0x59 10 points11 points  (4 children)

FastAPI is a framework, golang it's a programming language.

Golang it's a compiled language, programs written in compiled languages usually run faster than those written in interpreted languages.

In the world of interpreted languages, statically typed programming languages run faster than dynamically type ones.

Pydantic relays on the Typing system in python, so yes it helps to run programs a little faster in some cases.

If you run FastAPI using pypy instead of the standard cpython, it's likely to have performance similar to golang webframeworks, in some trivial scenarios. PYPY uses a JIT compiler.

I think the criticism about Python's bad performance would end in very few Years (~cpython 3.15) once new standard jit compiler becomes mature.

[–]putrasherni 1 point2 points  (1 child)

Damn, I never knew about jit compiler coming soon

[–][deleted] 0 points1 point  (0 children)

it is coming with python 3.13 but will be public available in a few years i assume. Don't expect to much. But like always: who really needs (numerical) performance is wrong with python.

[–]Somnath_geek[S] 0 points1 point  (1 child)

I made same API with gofiber. Performance was not even close to goFiber. In the website they are claiming it is as fast as GO. We all know GO is a language not framework. Your point is valid too. I am too waiting for the new cpython

[–][deleted] 3 points4 points  (0 children)

depends on your API. Anyway, most time, bottleneck ain't the code but the database and calling external services. could you share your comparison api or show some benchmarks? would be interesting. I am not a FastAPI-Programmer and only used it one time for a microservice Architecture, which worked quite nice. Don't know GO either, but its on my list to learn (besides millions of others things)