🔴 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_ahadСағат бұрын
FastAPI vs ExpressJs please
@vamshiaruru54947 сағат бұрын
this is like coughing baby vs atomic bomb
@AntonPutra7 сағат бұрын
haha
@AntonPutra5 сағат бұрын
Updated my checklist: 'Use non-blocking async libraries when possible.' 😊
@DavidSmith-ef4eh8 сағат бұрын
Spoiler: Go wins.
@AntonPutra7 сағат бұрын
😂
@christofflinde6 сағат бұрын
Spoiler: this does not come as a surprise. :)
@svetlinzarev34535 сағат бұрын
spoiler: rust wins :)
@mrlectusСағат бұрын
I didn't even have to watch the video to know that 😂
@pedro_alonso8 сағат бұрын
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
@AntonPutra7 сағат бұрын
yes sure
@pable26 сағат бұрын
@@AntonPutra Spring boot vs symfony + frankenPHP/swoole?
@mogaclub5 сағат бұрын
spring boot vs quarkus
@jorgetovar621Сағат бұрын
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!
@AlokSingh-rj1gt7 сағат бұрын
One of the fastest tortoise vs cheetah.
@AntonPutra7 сағат бұрын
😊
@SAsquirtle7 сағат бұрын
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.
@muray827 сағат бұрын
This is why he ask for PR in repo.
@SAsquirtle7 сағат бұрын
@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
@SAsquirtle7 сағат бұрын
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
@omlanke34667 сағат бұрын
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.
@tuanvumaihuynh7 сағат бұрын
Using asyncpg with proper configuration can indeed improve FastAPI's performance significantly. There benchmark in repo show that it outperforms pgx.
@pi3ni05 сағат бұрын
Based on this and other videos, I didn't realize how efficient Go was! Thanks for sharing
@mickhuby87864 сағат бұрын
Just what I’ve been waiting for! Thanks for doing these benchmarks.
@fluxcaruso3458 сағат бұрын
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-d6s8 сағат бұрын
hell yeah
@DavidSmith-ef4eh8 сағат бұрын
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.
@rodjenihm8 сағат бұрын
@@DavidSmith-ef4eh Is it even sacrifice in performance? Go might be even slower than C# and even Java nowadays.
@tpadilha848 сағат бұрын
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-ef4eh8 сағат бұрын
@@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.
@andreyvershkov4072Сағат бұрын
Top video! Thanks. Please make OpenSwoole/Swoole (PHP) comparison vs Go.
@ZuvielDrama5 сағат бұрын
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.
@allanamaral2587Сағат бұрын
And that’s a good thing! After spending hours profiling and debugging slow LINQ queries you start appreciating writing just SQL
@Bob-qz5yjСағат бұрын
C# has excellent aot support. You can often get one binary just like go if you prefer
@DavidSmith-ef4ehСағат бұрын
@@allanamaral2587 just log the query lol, then fix your linq code
@IncomingLegend8 сағат бұрын
try to compare Go with Gleam
@AntonPutra7 сағат бұрын
ok
@infantfrontender61316 сағат бұрын
It will be the same result as with an Elixir because Gleam uses the BEAM and OTP
@Gruak75 сағат бұрын
@@infantfrontender6131 Could be but Gleam has its own ecosystem and a different web framework so there might be some differences.
@KayandraJT3 сағат бұрын
@@infantfrontender6131 gleam is currently slower than elixir. the creator of gleam is focusing on improving performance so go slaps gleam atm
@subbotin.monster7 сағат бұрын
Could you compare Django and FastAPI?
@AntonPutra7 сағат бұрын
yes and flask
@Imam.Mehdi_3 сағат бұрын
Also I was curious how much a certain hardware can handle load,,, can you benchmark different VPs or ec2
@bartoszstasiak23726 минут бұрын
As a Django developer I would love to see this
@ridhotamma63316 сағат бұрын
FINALLY!, what I've waiting for so long, thank you Anton!
@AntonPutra5 сағат бұрын
my pleasure, i hope someone can improve it and i'll rerun it
@obamna367 сағат бұрын
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.
@AntonPutra7 сағат бұрын
i love rust
@roccociccone5976 сағат бұрын
I have tried rust for web development. Unless you need the utmost performance Go is going to get you 95% of the way.
@KayandraJT3 сағат бұрын
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.
@StingSting8443 сағат бұрын
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
@neoko72208 сағат бұрын
Waiting for php
@freedomseekerism8 сағат бұрын
lmao
@DavidSmith-ef4eh8 сағат бұрын
@@freedomseekerism you might be surprised that PHP (the swoole version) could be just 10% slower than go.
@DavidSmith-ef4eh8 сағат бұрын
of course, laravel will be on level of python lol
@Oleg777771008 сағат бұрын
Waiting for cobol
@AntonPutra7 сағат бұрын
i'll do swoole soon
@inithinx6 сағат бұрын
Please consider doing kotlin(ktor/springboot/native) vs golang(fiber/echo/stdlib)
@AntonPutra5 сағат бұрын
added
@qwerty67137 сағат бұрын
That's interesting that difference was only 7-10 times. But if we add business logic, than difference will be more significant
@AntonPutra7 сағат бұрын
sounds about right
@roccociccone5976 сағат бұрын
oh it is. As soon as you have any form of looping in your code python shits itself.
@ramonpereira44602 сағат бұрын
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.
@SnazzieTV8 сағат бұрын
Python and speed can never go in the same paragraph.
@DavidSmith-ef4eh8 сағат бұрын
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.
@AntonPutra7 сағат бұрын
haha
@saadhabashneh55877 сағат бұрын
FastAPI vs expressjs
@AntonPutra7 сағат бұрын
got it
@theuser3847 сағат бұрын
The real competitor for Go is Crystal, both compiled and tiny footprint.
@AntonPutra6 сағат бұрын
ok i'll take a look
@OlegKorsak3 сағат бұрын
it runs the same as Django because of sync nature of your app. IO is getting bottlenecked. waiting for a true async version
@WebNinja-r2b5 сағат бұрын
Python Emmett vs Rust Actix you will LOVE this
@toragodzen6 сағат бұрын
When Python surpasses Go, it will truly become the best programming language ever! )
@roccociccone5976 сағат бұрын
so never then? Python can't even match JS and JS sucks balls for performance.
@AntonPutra5 сағат бұрын
i'll be waiting
@BlackistedGod8 сағат бұрын
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.
@AntonPutra7 сағат бұрын
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
@iddiiddrisu59713 сағат бұрын
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.
@pickle19873 сағат бұрын
Comparing python to go is like comparing some random generic Coke with CocaCola
@jholansabaria60017 сағат бұрын
try Go vs PHP (using Open Swoole)
@AntonPutra7 сағат бұрын
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.
@DhavalAhir103 сағат бұрын
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.
@AntonPutraСағат бұрын
I was part of the MistSys startup when Juniper acquired us. Right now, those buildings in Sunnyvale look like ghost towns after covid
@trsdesrn52465 сағат бұрын
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.
@rida_brahim3 сағат бұрын
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).
@hooyah4 сағат бұрын
OOT# golang chi is only a package for routers. that means chi perfomance is similar to std lib?
@oxXPMXxo6 сағат бұрын
Now I wanna see Java 21 virtual threads if it's legit
@AntonPutra5 сағат бұрын
will do, probably 22
@SergeyBevzuk7 сағат бұрын
Swoole/OpenSwoole vs Go/Rust/C#
@DavidSmith-ef4eh7 сағат бұрын
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.
@AntonPutra7 сағат бұрын
yes, i'll do swoole soon
@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?
@moochalshrek65196 сағат бұрын
FastAPI and Node.Js vs Bun!
@leularia3 сағат бұрын
considering instagram use python, Javascript for Backend is not that much bad idea !
@kvs77205 сағат бұрын
can you plan to do one DevOps end-to-end project frontend and backend your all videos is clear content @TQ
@carlos-rian7 сағат бұрын
Amazing ❤
@AntonPutra7 сағат бұрын
thank you!
@huuphong36573 сағат бұрын
could you compare NestJs (express) vs Go (Gin) one day plz
@live4wap8 сағат бұрын
Not that fast
@DavidSmith-ef4eh8 сағат бұрын
well, it was a fast video, since fast-api couldn't keep up half way through. Otherwise it might have lasted 20 minutes.
@AntonPutra7 сағат бұрын
haha
@PouriyaJamshidi6 сағат бұрын
Any progress with Nim, Anton?
@AntonPutra5 сағат бұрын
not yet
@PTsanti50104 сағат бұрын
Can you please show how to create the clients ?
@Mr.BinarySniper5 сағат бұрын
0:10 people can easily understand which is golang and which is fastapi.
@techinsider3611Сағат бұрын
Please do also test litestar vs go lang vs fast api.
@leandroapariciodoprado70727 сағат бұрын
Compare AWS and Azure and give us a request per dollar report.
@AntonPutra7 сағат бұрын
i was thinking about this as well, using thanos to compare different cloud providers in a single dashboard
@GiacomoMiolo8 сағат бұрын
Axum vs FastAPI?
@hughesabsalom5267 сағат бұрын
Come on bro that will be a bl**d bath😂😂
@AntonPutra7 сағат бұрын
well maybe
@vivekchaudhary57285 сағат бұрын
SpringBoot (Highest Optimisation) vs GO please
@BORNINSPACE5 сағат бұрын
Try Robyn, Rust based python framework
@MrLOPIU226 сағат бұрын
They should change the name for slowapi
@AntonPutra5 сағат бұрын
😊
@ysomad5 сағат бұрын
NATS vs KAFKA / RabbitmQ please
@brunocascio4 сағат бұрын
comparing compiled vs interpreted does not make sense. Before the test is completed we would know who is going to win xD
@gayalmn3 сағат бұрын
For when an elixir comparison ?
@АрианШапиро7 сағат бұрын
Антон, позязя питон сравни с нодой и bun
@AntonPutra7 сағат бұрын
sure, i'll wait for someone to improve fastapi a little and then i'll compare it with node/deno/bun
@shreyaspatange86537 сағат бұрын
do django next please
@AntonPutra7 сағат бұрын
yes i'll do django as well
@saiphaneeshk.h.54827 сағат бұрын
7:15 3500 or 35000?
@AntonPutra7 сағат бұрын
i misspoke, 3,500 rps
@AndrewTikhonov7 сағат бұрын
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?
@omlanke34667 сағат бұрын
Why not use asyncpg directly? ORMs slow down the app
@AntonPutra7 сағат бұрын
i'm refreshing to return it back to the client, i do the same thing for go
@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 😁
@WaneyMamahit6 сағат бұрын
Please use Pypy for FastAPI
@AntonPutra5 сағат бұрын
ok but they don't use it in the "prod" example - github.com/fastapi/full-stack-fastapi-template/blob/master/backend/Dockerfile#L1
@zungaloca34 минут бұрын
i despies all interpreted languages, even java
@daymaker_trading6 сағат бұрын
Bro come on 🤣
@AntonPutra5 сағат бұрын
😇
@BarakaAndrew5 сағат бұрын
I honestly don't understand people who use python for anything other than ML even that is arguable. Its architecture is so bad