🔴 To support my channel, I'd like to offer Mentorship/On-the-Job Support/Consulting (me@antonputra.com) 🍿 Benchmarks: kzbin.info/aero/PLiMWaCMwGJXmcDLvMQeORJ-j_jayKaLVn&si=p-UOaVM_6_SFx52H 👋 AWS is expensive - Infra Support Fund: buymeacoffee.com/antonputra
@my_name_is_ahad4 күн бұрын
FastAPI vs ExpressJs please
@LW123864 күн бұрын
Hey, what software do you use to run those benchmarks?
@MDFireX53 күн бұрын
Go vs Deno2 vs Php
@vamshiaruru54944 күн бұрын
this is like coughing baby vs atomic bomb
@AntonPutra4 күн бұрын
haha
@Yusuf-ok5rk2 күн бұрын
@@_vk03 not really
@DavidSmith-ef4eh4 күн бұрын
Spoiler: Go wins.
@AntonPutra4 күн бұрын
😂
@christofflinde4 күн бұрын
Spoiler: this does not come as a surprise. :)
@svetlinzarev34534 күн бұрын
spoiler: rust wins :)
@mrlectus4 күн бұрын
I didn't even have to watch the video to know that 😂
@laas294 күн бұрын
Zig rules over all
@AntonPutra4 күн бұрын
Updated my checklist: 'Use non-blocking async libraries when possible.' 😊
@minma0226250 минут бұрын
Where can I find you checklist?
@AntonPutra17 сағат бұрын
Thank you all who helped to improve the Python application. I'll release round 2 in a few days.
@pedro_alonso4 күн бұрын
Can we have a spring boot performance benchmark? I'm curious how it will perform in comparison with other tools/languages and with virtual threads and without it
@AntonPutra4 күн бұрын
yes sure
@pable24 күн бұрын
@@AntonPutra Spring boot vs symfony + frankenPHP/swoole?
@mogaclub4 күн бұрын
spring boot vs quarkus
@AlokSingh-rj1gt4 күн бұрын
One of the fastest tortoise vs cheetah.
@AntonPutra4 күн бұрын
😊
@fluxcaruso3454 күн бұрын
So the conclusion is use go for any backend service if you dont have any spesific requirements that force you to use another language
@boburnomonov-d6s4 күн бұрын
hell yeah
@DavidSmith-ef4eh4 күн бұрын
nah, dotnet. I rather sacrifice 20% of performance for all the nice things you get in dotnet, like pattern matching, extension methods, linq and of course the most advanced ORM in the world.
@rodjenihm4 күн бұрын
@@DavidSmith-ef4eh Is it even sacrifice in performance? Go might be even slower than C# and even Java nowadays.
@tpadilha844 күн бұрын
I suggest you to use whatever technology makes you the happiest and most productive. These benchmarks are rarely representative of real world, most apps will never reach the level of concurrency tested here.
@DavidSmith-ef4eh4 күн бұрын
@@rodjenihm nah, he did a benchmark, dotnet vs go. although it's dotnet 8, and go won. I believe go would even beat dotnet 9, but not by much.
@EddaFredericks3 күн бұрын
enterprise-ai AI fixes this. Python vs Go benchmark comparison.
@ridhotamma63314 күн бұрын
FINALLY!, what I've waiting for so long, thank you Anton!
@AntonPutra4 күн бұрын
my pleasure, i hope someone can improve it and i'll rerun it
@SAsquirtle4 күн бұрын
I understand not everyone knows every language/framework well enough to make a decent app but cmon you could've done some more research. 1. Why are you using a synchronous pg driver with an async endpoint? this blocks the event loop till each query finishes. If you absolutely want to use the sync driver, use plain def routes without async. 2. Why aren't you using asyncpg with async endpoints? the whole point of FastAPI is to make completely async REST APIs which use async packages. If you cannot find an async package or method, use run_in_threadpool with the sync method.
@muray824 күн бұрын
This is why he ask for PR in repo.
@SAsquirtle4 күн бұрын
@muray82 then what's the point of the video? PRs are fine for minor improvements or enhancements but these are major issues which should've been addressed before the video was made
@SAsquirtle4 күн бұрын
Also want to clarify that even with the changes I mentioned, python and fastapi will still lose terribly but no where close to this extent
@omlanke34664 күн бұрын
I was looking for this comment. He is not using an ORM in go, but he uses SQLModel in python. ORMs significantly slow down apps too. This comparison should be retested using FastAPI with plain asyncpg.
@tuanvumaihuynh4 күн бұрын
Using asyncpg with proper configuration can indeed improve FastAPI's performance significantly. There benchmark in repo show that it outperforms pgx.
@pi3ni04 күн бұрын
Based on this and other videos, I didn't realize how efficient Go was! Thanks for sharing
@egida64863 күн бұрын
its not Go that is efficient here ...
@pi3ni03 күн бұрын
@@egida6486 What is then?
@egida64863 күн бұрын
@@pi3ni0 its just python that is very inefficient.
@mickhuby87864 күн бұрын
Just what I’ve been waiting for! Thanks for doing these benchmarks.
@ZuvielDrama4 күн бұрын
The Switch from C# to Golang was a right one. Golang has the best simplicty / speed ratio. Using rust or c++ is more performant than golang. The costs are complexity in the codebase. Not to mention golang gives you one binary to deploy. This compared with c# dll hell...
@DavidSmith-ef4eh4 күн бұрын
which orm language do you use for go. Most of them require you to write SQL or generate helper code based on exisiting sql files.
@allanamaral25874 күн бұрын
And that’s a good thing! After spending hours profiling and debugging slow LINQ queries you start appreciating writing just SQL
@Bob-qz5yj4 күн бұрын
C# has excellent aot support. You can often get one binary just like go if you prefer
@DavidSmith-ef4eh4 күн бұрын
@@allanamaral2587 just log the query lol, then fix your linq code
@123mrfarid4 күн бұрын
@@DavidSmith-ef4ehactually i prefer writing raw sql. Much more flexibility and i can do much more complex data selection or manipulation which is quite difficult to achieve with orms. I use orm of course but only for simple queries.
@IncomingLegend4 күн бұрын
try to compare Go with Gleam
@AntonPutra4 күн бұрын
ok
@infantfrontender61314 күн бұрын
It will be the same result as with an Elixir because Gleam uses the BEAM and OTP
@Gruak74 күн бұрын
@@infantfrontender6131 Could be but Gleam has its own ecosystem and a different web framework so there might be some differences.
@KayandraJT4 күн бұрын
@@infantfrontender6131 gleam is currently slower than elixir. the creator of gleam is focusing on improving performance so go slaps gleam atm
@andreyvershkov40724 күн бұрын
Top video! Thanks. Please make OpenSwoole/Swoole (PHP) comparison vs Go.
@AntonPutra4 күн бұрын
thank you!
@obamna364 күн бұрын
Go is always a good pick for api server. good dev ux and decent performance. if you want top tier performance but with a longer time to write pick rust.
@AntonPutra4 күн бұрын
i love rust
@roccociccone5974 күн бұрын
I have tried rust for web development. Unless you need the utmost performance Go is going to get you 95% of the way.
@KayandraJT4 күн бұрын
tbh i used to be one of those people who thought like this... then earlier this year, i decided to give rust the love it needs and learned it... my productivity in go and rust is around the same also because i still use both of them. rust for me does not take longer time to write, i'm about as productive with both.
@jorgetovar6214 күн бұрын
It would be great to have a long video setting up all of this and learning how to perform these benchmarks. That way, we could better understand the process and contribute more effectively to this code. Really good job!
@SnazzieTV4 күн бұрын
Python and speed can never go in the same paragraph.
@DavidSmith-ef4eh4 күн бұрын
maybe you could get python like syntax in the fastest language that even beats rust. But don't follow that project right now. It's called mojo, if you want to look it up.
@AntonPutra4 күн бұрын
haha
@dmitrii_cl4 күн бұрын
SlowAPI
@thegrumpydeveloper3 күн бұрын
When they pass things down things work well. Python is hands down the ai winner and pandas and other data science libs are pretty cool. Wish academics had chosen go though because I wonder how much faster things could have been.
@subbotin.monster4 күн бұрын
Could you compare Django and FastAPI?
@AntonPutra4 күн бұрын
yes and flask
@Imam.Mehdi_4 күн бұрын
Also I was curious how much a certain hardware can handle load,,, can you benchmark different VPs or ec2
@bartoszstasiak2374 күн бұрын
As a Django developer I would love to see this
@sauravagun97512 күн бұрын
no wonder why i have to learn go next year, gonna be my 3rd language yayyyy! multilingual in programming it is 😎😎
@inithinx4 күн бұрын
Please consider doing kotlin(ktor/springboot/native) vs golang(fiber/echo/stdlib)
@AntonPutra4 күн бұрын
added
@AntonPutra3 күн бұрын
► PR by Uday to improve FastAPI - github.com/antonputra/tutorials/pull/375 ► PR by Evgenii to improve FastAPI - github.com/antonputra/tutorials/pull/376 ► PR by Viky to improve FastAPI - github.com/antonputra/tutorials/pull/377
@neoko72204 күн бұрын
Waiting for php
@freedomseekerism4 күн бұрын
lmao
@DavidSmith-ef4eh4 күн бұрын
@@freedomseekerism you might be surprised that PHP (the swoole version) could be just 10% slower than go.
@DavidSmith-ef4eh4 күн бұрын
of course, laravel will be on level of python lol
@Oleg777771004 күн бұрын
Waiting for cobol
@AntonPutra4 күн бұрын
i'll do swoole soon
@theuser3844 күн бұрын
The real competitor for Go is Crystal, both compiled and tiny footprint.
@AntonPutra4 күн бұрын
ok i'll take a look
@alemao1824 күн бұрын
awesome content man! would be nice a python vs python comparison as well, something like fastapi vs django-ninja vs litestar
@franklynd13 сағат бұрын
Does this improve if you use the pypi JIT with FastAPI ?
@skippednote3 күн бұрын
I'm assuming you are computing most of the metrics using nginx ingress. If so can you please share your configurations and the dashboard queries?
@ramonpereira44604 күн бұрын
I see that your are using C instances! Thanks a lot, Anton. Maybe try C instances vs M instances! Also, at my previous job, we had 1000 instances of FastAPI for ML inference and 1 Golang instance distributing to all of them. Golang is very fast.
@BarakaAndrew4 күн бұрын
I honestly don't understand people who use python for anything other than ML even that is arguable. Its architecture is so bad
@AntonPutra4 күн бұрын
I was expecting much better results
@dpdx_05h6 сағат бұрын
Спасибо, интересные видео!
@amirhmahmoodi46073 күн бұрын
You did not even use none blocking db driver for python, how can i trust you after this?
@AntonPutra3 күн бұрын
Collecting feedback and rerunning a test in a few days
@stefanhoromnea60643 күн бұрын
Hi, nice comparison! What did you use to make the graphs?
@denysmelnyk39692 күн бұрын
grafana
@VladimirS-h9o3 күн бұрын
Why in on 7:28 Connection Pool Size of Go increased and after that more than Python?
@appsky7982Күн бұрын
I see you have received lots of PRs for fastapi. I can't wait for the second benchmark
@EricSouzarys2 күн бұрын
Hey Anton! Any chances we can get a new comparison with the java quarkus reactive code?
@ferdynandkiepski50262 күн бұрын
Now this is actually kind of surprising to me. Python libraries all call into C/C++/Rust. I'd really expect it to be better. I guess the overhead from using such a slow language to call into library functions can't be hidden.
@live4wap4 күн бұрын
Not that fast
@DavidSmith-ef4eh4 күн бұрын
well, it was a fast video, since fast-api couldn't keep up half way through. Otherwise it might have lasted 20 minutes.
@AntonPutra4 күн бұрын
haha
@gibzrival1565Күн бұрын
Go has become the standard language for benchmark comparisons
@AntonPutra17 сағат бұрын
► PR by Uday to improve FastAPI - github.com/antonputra/tutorials/pull/384 ► PR by Paweł to improve FastAPI - github.com/antonputra/tutorials/pull/386 ► PR by Uday to improve FastAPI - github.com/antonputra/tutorials/pull/387
@trsdesrn52464 күн бұрын
Just a newbie question: if Python is so slow compared to Go in almost all the frameworks, what is the advantage to adopt Python over Go for such applications like backend development?
@DavidSmith-ef4eh4 күн бұрын
well, go lacks language features and is very verbose. which means you have to type a lot, but the code is easy to understand. personally not a fan of typing a lot. But even then, I'd still use go over python on gunpoint.
@MrBeltalowdaКүн бұрын
pyhon is much cheaper and faster to iterate.
@OlegKorsak4 күн бұрын
it runs the same as Django because of sync nature of your app. IO is getting bottlenecked. waiting for a true async version
@StingSting8444 күн бұрын
This was brutal. Yes, the python version can be really fast too but the main point is that the speed in Go is something you get by default. If you're building for release speed then use python. If you are building for performance then use Go
@BlackistedGod4 күн бұрын
Its better to do this comparison with another interpreted language like PHP (Laravel, Symfony) or JS frameworks (Express, Next). Python is the slowest language and we would already know the result if its being compared to any compiled languages.
@AntonPutra4 күн бұрын
true, but fastapi uses a lot of new features, including coroutines and type hints, and on the official website, they compare fastapi with go and nodejs
@BlackistedGod3 күн бұрын
@@AntonPutra then their official website could be full of BS they even dare mention G hahaha I doubt that SlowAPI could even beat Swoole/RoadRunner or NodeJS. I hope you can run benchmark on either one of them or both
@saikirannadipilli78312 күн бұрын
Hi @AntonPutra can you please do benchmark for go vs c++(Poco library)
@DhavalAhir104 күн бұрын
Anton, can you please tell me more about the company "Juniper Networks"? I am Python Dev and have plan to apply there. I heard the company is quite good with decent work culture.
@AntonPutra4 күн бұрын
I was part of the MistSys startup when Juniper acquired us. Right now, those buildings in Sunnyvale look like ghost towns after covid
@DhavalAhir103 күн бұрын
@AntonPutra ohhh that's the case. Btw I am from India. They offices in India.
@kostan3v3 күн бұрын
Would we see Dart (with shelf) any time soon?
@hooyah4 күн бұрын
OOT# golang chi is only a package for routers. that means chi perfomance is similar to std lib?
@qwerty67134 күн бұрын
That's interesting that difference was only 7-10 times. But if we add business logic, than difference will be more significant
@AntonPutra4 күн бұрын
sounds about right
@roccociccone5974 күн бұрын
oh it is. As soon as you have any form of looping in your code python shits itself.
@j-p-d-e-v3 күн бұрын
@@roccociccone597 agree, I parse large data if I have time I use rust to do it and its x10 to x20 faster than python. I just use python if the team needs an immediate output.
@SergeyBevzuk4 күн бұрын
Swoole/OpenSwoole vs Go/Rust/C#
@DavidSmith-ef4eh4 күн бұрын
swoole 6 is about to be released, and we didn't even get swoole 5. At this point, I'd rather wait for him to do swoole 6.
@AntonPutra4 күн бұрын
yes, i'll do swoole soon
@GiacomoMiolo4 күн бұрын
Axum vs FastAPI?
@hughesabsalom5264 күн бұрын
Come on bro that will be a bl**d bath😂😂
@AntonPutra4 күн бұрын
well maybe
@GiacomoMiolo4 күн бұрын
@@hughesabsalom526 just giving Anton a challenge to show in the same graph drastically different scales eheh
@AndrewTikhonov4 күн бұрын
Why are you refreshing model after insert? it is useless and only make additional requests. I am also not sure sqlmodel is a good thing to use. Try mapping sqlalchemy to dataclasses directly. Can you please measure how fast will be golang vs python implementing facet search over 10million table with (unique fitlter combinations on each request, of cause). Who will be faster?
@omlanke34664 күн бұрын
Why not use asyncpg directly? ORMs slow down the app
@AntonPutra4 күн бұрын
i'm refreshing to return it back to the client, i do the same thing for go
@MusKel4 күн бұрын
When Kafka vs Nats?
@BORNINSPACE4 күн бұрын
Try Robyn, Rust based python framework
@AntonPutra4 күн бұрын
Ok, I'll take a look, but it has fewer than 5k stars
@BORNINSPACE3 күн бұрын
@@AntonPutra its new yes, but from my tests when you need speed in python it's Sanic and Robyn, they are like 2-4 times faster then FastAPI. FastApi is nice becouse it has good support for async, does OpenAPI docs automaticaly and has build in type checking with Pydantic. But becouse of pydantic it does aditional checks for each request, if you remove Pydantic you will see an easy 2x r/s improvement) Its fast for development speed though)
@PTsanti50104 күн бұрын
Can you please show how to create the clients ?
@AntonPutra4 күн бұрын
Sure, well, I have a bunch of them in my repo
@PTsanti50103 күн бұрын
@@AntonPutracan you share the code of the client ?
@PouriyaJamshidi4 күн бұрын
Any progress with Nim, Anton?
@AntonPutra4 күн бұрын
not yet
@bebus70173 күн бұрын
Which ASGI server is FastAPI running on in this comparison? It would also be helpful to compare different ASGI servers (e.g., Nginx Unit, Uvicorn, Daphne, etc.) using the same Python app for a broader perspective. Additionally, consider using a lighter framework like Starlette (the foundation of FastAPI) for such benchmarks, as it avoids the overhead introduced by FastAPI’s data validation features
@bebus70173 күн бұрын
After checking the source code, I noticed that the comparison runs FastAPI using fastapi run, which defaults to Uvicorn as the ASGI server. However, my point about comparing different ASGI servers remains relevant. A broader analysis with different servers could provide deeper insights into performance variations
@garveyebsmith3 күн бұрын
Thanks Anton!
@carlos_rijo3 күн бұрын
Looking at these benchmarks, I guess "Go" is top 1 right?
@poet96384 күн бұрын
when I use python to code llm, I use fastapi. This is because i want to use codes created by a large number of scholars. I like Python so much~
@pekhov214 күн бұрын
Hey, I have an idea for the next video. What if compare interpreted languages. PHP, JS(node), RUBY, PYTHON And run PHP with Roadrunner. What do you think about this?
@WebNinja-r2b4 күн бұрын
Python Emmett vs Rust Actix you will LOVE this
@toragodzen4 күн бұрын
When Python surpasses Go, it will truly become the best programming language ever! )
@roccociccone5974 күн бұрын
so never then? Python can't even match JS and JS sucks balls for performance.
@AntonPutra4 күн бұрын
i'll be waiting
@AB-ms7my2 күн бұрын
Hello again! I guess that CPython is your primary topic. Python is a language. Python has more than one implementation.
@saadhabashneh55874 күн бұрын
FastAPI vs expressjs
@AntonPutra4 күн бұрын
got it
@Yue2u3 күн бұрын
In first test you create data every time in endpoint, python isn't fast working with memory operations like this, it makes app a lot slower than it could be. In second test using synchronous sqlalchemy inside async function slows fastapi a lot, it works like django in this case, executing code sequentialy. So, python is slower than go, thats obvious. However the benchmark isn't really fair.
@MrLOPIU224 күн бұрын
They should change the name for slowapi
@AntonPutra4 күн бұрын
😊
@oxXPMXxo4 күн бұрын
Now I wanna see Java 21 virtual threads if it's legit
@AntonPutra4 күн бұрын
will do, probably 22
@pickle19874 күн бұрын
Comparing python to go is like comparing some random generic Coke with CocaCola
@carlos-rian4 күн бұрын
Amazing ❤
@AntonPutra4 күн бұрын
thank you!
@rida_brahim4 күн бұрын
at this point it's pretty obvious that python backend isn't the go to tbh, I don't care if you got 10 users or 100m users you just avoid python. the amount of time and energy you would spend on python can be spent on elevating your skills on a better language ( talking web development only).
@huuphong36574 күн бұрын
could you compare NestJs (express) vs Go (Gin) one day plz
@iddiiddrisu59714 күн бұрын
Golang is definitely winning here!!! 😂 FastAPI vs Spring might be more fair. I can't think of any golang lib that would be as slow a FastAPI in terms of latency. Let me watch now and see.
@kamikaz1k2 күн бұрын
DSQL vs RDS?
@gayalmn4 күн бұрын
For when an elixir comparison ?
@Mr.BinarySniper4 күн бұрын
0:10 people can easily understand which is golang and which is fastapi.
@AntonPutra4 күн бұрын
yeah i know
@RayDenis2 күн бұрын
Yeah all you have to do is look at the chart
@pi3ni0Күн бұрын
Waiting for round 2 with PRs for FastAPI
@AntonPutraКүн бұрын
will do soon
@pi3ni0Күн бұрын
@@AntonPutra Yeah, no pressure, really appreciate you doing the benchmarks
@alexbrik18024 күн бұрын
Love your work, mate! I personally see Go as the perfect choice for balance between performance, development speed, and maintainability Glad to see your tests confirm this somehow 😁
@RealEngineer3 күн бұрын
Soooo what we need now is C# vs Java 😃
@АрианШапиро4 күн бұрын
Антон, позязя питон сравни с нодой и bun
@AntonPutra4 күн бұрын
sure, i'll wait for someone to improve fastapi a little and then i'll compare it with node/deno/bun
@saiphaneeshk.h.54824 күн бұрын
7:15 3500 or 35000?
@AntonPutra4 күн бұрын
i misspoke, 3,500 rps
@kvs77204 күн бұрын
can you plan to do one DevOps end-to-end project frontend and backend your all videos is clear content @TQ
@leularia4 күн бұрын
considering instagram use python, Javascript for Backend is not that much bad idea !
@ArcticPrimal3 күн бұрын
Please test Golang Hertz and Bun router
@akinshipeolaoluwa7613 күн бұрын
This did not test fastAPI at all. You need to use non blocking driver for the database and gunicorn server so as to be able to use more process. Please redo this video as it very important. Thanks
@brunocascio4 күн бұрын
comparing compiled vs interpreted does not make sense. Before the test is completed we would know who is going to win xD
@techinsider36114 күн бұрын
Please do also test litestar vs go lang vs fast api.
@leandroapariciodoprado70724 күн бұрын
Compare AWS and Azure and give us a request per dollar report.
@AntonPutra4 күн бұрын
i was thinking about this as well, using thanos to compare different cloud providers in a single dashboard
@cinos39113 күн бұрын
C++ vs Rust, please 🙏
@jholansabaria60014 күн бұрын
try Go vs PHP (using Open Swoole)
@AntonPutra4 күн бұрын
yes soon
@DavidSmith-ef4eh4 күн бұрын
@@AntonPutra I'd use swoole, swoole-src github. Open swoole seems to be lagging behind. Ideally swoole version 6 which will be soon released.
@shreyaspatange86534 күн бұрын
do django next please
@AntonPutra4 күн бұрын
yes i'll do django as well
@snippletrap2 күн бұрын
Try Litestar, a FastAPI competitor that claims to be 2x as fast
@ranggatohjaya54713 күн бұрын
RabbitMQ Stream vs Kafka vs Redis Stream vs Pulsar
@vivekchaudhary57284 күн бұрын
SpringBoot (Highest Optimisation) vs GO please
@moochalshrek65194 күн бұрын
FastAPI and Node.Js vs Bun!
@ysomad4 күн бұрын
NATS vs KAFKA / RabbitmQ please
@iddqd20482 күн бұрын
Those test on AWS are nonsense. The same type instance performance can be different by 40%!!!!
@j-p-d-e-v3 күн бұрын
Python hogs a lof of memory and cpu thats why Im slowly rewriting my web app to Rust.
@mohagungnursalim82193 күн бұрын
Php swoole/frankenphp vs go
@WaneyMamahit4 күн бұрын
Please use Pypy for FastAPI
@AntonPutra4 күн бұрын
ok but they don't use it in the "prod" example - github.com/fastapi/full-stack-fastapi-template/blob/master/backend/Dockerfile#L1