Go (Golang) Performance Benchmark (gnet vs fiber vs fasthttp vs net/http)

  Рет қаралды 14,645

Anton Putra

Anton Putra

Күн бұрын

Пікірлер: 134
@AntonPutra
@AntonPutra 7 күн бұрын
🔴 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
@gaby_ops
@gaby_ops 6 күн бұрын
👋🏻 GoFiber maintainer here, we have opened an issue in our repo to investigate the crash. Thanks for the awesome video! 💪 We can't see anything in the example code that would cause this, so it must be something internal to Fiber.
@Akhbash
@Akhbash 7 күн бұрын
AWS should sponsor this channel!
@AntonPutra
@AntonPutra 7 күн бұрын
yeah i'll run out of money soon 😭
@bjbegui
@bjbegui 7 күн бұрын
@@AntonPutra I'll throw some cash your way soon
@tandemwarhead
@tandemwarhead 7 күн бұрын
TLDR: net framework choice does not matter for 99% of the workloads
@AntonPutra
@AntonPutra 7 күн бұрын
true
@therealgamingmaniac
@therealgamingmaniac 7 күн бұрын
Yes, if you're confused because of 2-5% difference at most, just switch to Rust,C,Zig or C++
@Kirides
@Kirides 7 күн бұрын
but my router-microbenchmarks tell me otherwise! gin/echo/... are waaaay faster.... yea - people really don't understand their own performance needs 99.9% of the time. Most of us don't build a highly scalable memory-based cache services, but regular "LOB" applications that talk to other services.
@winfle
@winfle 6 күн бұрын
⁠@@Kiridesif you need performance, why use go? ;)
@dejangegic
@dejangegic 6 күн бұрын
​@@winfleBecause Go is very fast for a garbage collected language. Most of the infrastructure can be built with it actually. Do critical parts still might require some MMM control, but in general, it's great. Especially compared to what's usually used: PHP, JS, Ruby, Python etc.
@MrBoBrilO
@MrBoBrilO 7 күн бұрын
We need a guide on how to do these tests ourself >:)
@AntonPutra
@AntonPutra 7 күн бұрын
i have all the pieces on my channel from creating an eks cluster to monitoring containers in k8s and source code is under each video
@jordinario
@jordinario 7 күн бұрын
Hi Anton, been following your videos for a while now, they are always great! Hopefully you can keep up with it for the longest time! Cheers from Brazil
@Qrzychu92
@Qrzychu92 7 күн бұрын
as always, great video. Maybe small feedback, could you show also actual MBs of memory in graph? It's hard to compare the values between different videos, and I don't expect you to publish every possible permutation of technologies :)
@AntonPutra
@AntonPutra 7 күн бұрын
got it, i'll convert it to actual usage next time
@snowleo777
@snowleo777 Күн бұрын
Круто, вы делаете интересные и актуальные тесты. Всегда с большим удовольствием смотрю ваши видео.
@nabilpatel970
@nabilpatel970 7 күн бұрын
JavaScript backend libraries. Such as NestJs, express, fastify etc please
@roccociccone597
@roccociccone597 4 күн бұрын
Lol imagine using JS for backend services.
@dermuschelschluerfer
@dermuschelschluerfer 3 күн бұрын
@@roccociccone597 sounds like guaranteed 100ms latency form the start
@mujibulhaquetanim
@mujibulhaquetanim 2 күн бұрын
@@roccociccone597 what lol! it is being used widely.
@trustlang_ua
@trustlang_ua 6 күн бұрын
idea for next video: nest.js with fastify nest.js with express
@Figurum
@Figurum 4 күн бұрын
vs bun vs go
@eduardoolat
@eduardoolat 6 күн бұрын
Your videos are gold! Can you please compare SQLite vs rqlite vs libsql (turso)?
@AntonPutra
@AntonPutra 6 күн бұрын
thanks! added
@TheHTMLCode
@TheHTMLCode 5 күн бұрын
Awesome as always. I’d love to see Go vs PHP8 vs PHP8 using Swoole
@AntonPutra
@AntonPutra 4 күн бұрын
thanks! i'll do php soon
@mohit84604
@mohit84604 7 күн бұрын
Event loop cannot be fast when you have computation in routes,and you are not offloading that thing to another go routine.
@AntonPutra
@AntonPutra 7 күн бұрын
got it thanks!
@ievgenmajor3301
@ievgenmajor3301 7 күн бұрын
Good stuff. Good stuff.
@AntonPutra
@AntonPutra 7 күн бұрын
thank you!
@dimasarestu2043
@dimasarestu2043 7 күн бұрын
pls benchmark mysql 8/8.4/9 its worth it for upgrade or not
@AntonPutra
@AntonPutra 7 күн бұрын
ok added
@roganl
@roganl 7 күн бұрын
Anton, another beautiful comparison - that these tool authors should be tracking independently. I am concerned that you may be polluting your results if you are running these tests concurrently against the same shared postgres instance - as that's a shared resource that will cross contaminate the results
@UwU-f2a
@UwU-f2a 7 күн бұрын
maybe test using a postgresql driver that has pool size setting, the driver must be the same for all the framework here to make it apple to apple, like pgx for example
@AntonPutra
@AntonPutra 7 күн бұрын
yes i use exactly the same driver and not only that, i use exactly the same method pool size setting - github.com/antonputra/tutorials/blob/main/lessons/229/myapp/db/db.go#L13-L14 db insert - github.com/antonputra/tutorials/blob/main/lessons/229/myapp/device/device.go#L27
@shm236
@shm236 7 күн бұрын
Gnet seems interesting. I wonder why their memory useage was so much less in the first test.
@marianivanov6431
@marianivanov6431 7 күн бұрын
can you show who is win with image sometimes i cant understand which tech is best
@AntonPutra
@AntonPutra 7 күн бұрын
stdlib is great for low latency, fasthttp for throughput
@davidgazda4585
@davidgazda4585 7 күн бұрын
Create please rank table of language+framework with its results
@papryk1159
@papryk1159 6 күн бұрын
your videos are great man, binge watching them all the time! regarding another benchmark - what about some storage solutions? Rook vs OpenEBS?
@ListenSomething
@ListenSomething 7 күн бұрын
Thank you for the comparison. I just want to tell you can increase volume a bit. It sounds very low.
@mikolajsemeniuk8574
@mikolajsemeniuk8574 6 күн бұрын
Great video !
@carlhandy
@carlhandy 6 күн бұрын
Always wondered about how much this is costing you. Maybe instead of AWS use Digital Ocean, Linode or some cheaper VPS alternative.
@AntonPutra
@AntonPutra 6 күн бұрын
yeah it is costly
@jakubklecki2963
@jakubklecki2963 7 күн бұрын
Okay so I'm just going to stick to stdlib, if I ever get 10k requests/sec (very unlikely) only then I will start thinking about other options
@AntonPutra
@AntonPutra 7 күн бұрын
fair but think about middleware as well
@Nick-yd3rc
@Nick-yd3rc 7 күн бұрын
Yes and you need to consider your actual payloads and latency.
@cheatoffchannel6320
@cheatoffchannel6320 7 күн бұрын
Python FastAPI please 🙏, it’s gonna be surprisingly fast.
@gaby_ops
@gaby_ops 6 күн бұрын
No, it won't be compared to Golang
@lachlanm9304
@lachlanm9304 7 күн бұрын
framework that is never talked about is golang iris, would like to see that compares too all of these ones
@fusionfuryx
@fusionfuryx 7 күн бұрын
Can you benchmark FastAPI vs Go stdlib?
@AntonPutra
@AntonPutra 7 күн бұрын
yes but why stdlib and not fasthttp
@SilasDuarte-e9k
@SilasDuarte-e9k 7 күн бұрын
​@@AntonPutra I believe that in production people tend to use stdlib in Go, and some people believe that FastAPI can be an alternative to Go.
@cheatoffchannel6320
@cheatoffchannel6320 7 күн бұрын
Yeah would be great to know how FastAPI stands against any compiled language frameworks
@roccociccone597
@roccociccone597 4 күн бұрын
@@SilasDuarte-e9k spoiler: it can’t. We literally moved from FastAPI to Go.
@SilasDuarte-e9k
@SilasDuarte-e9k 4 күн бұрын
@@roccociccone597 I know, but some people need to see to believe 😅 I prefer Go over Python 9/10 days
@w1png
@w1png 7 күн бұрын
Any plans for minikube tutorial part 4? I know it didnt get a lot of views but its such a great tutorial series
@AntonPutra
@AntonPutra 7 күн бұрын
i may do more tutorials soon
@shinebayar
@shinebayar 7 күн бұрын
Wow framework claims that it's fast, but actually is fast? That's new.
@martinhotmann7868
@martinhotmann7868 7 күн бұрын
Yeeeeeeah :D Finally .. love you so much! (◕‿◕)
@AntonPutra
@AntonPutra 7 күн бұрын
will now compare with other fastest frameworks
@amig0842
@amig0842 7 күн бұрын
@@AntonPutra gnet and zzz (zig) 😋😋😋
@brianarnold9149
@brianarnold9149 7 күн бұрын
Please compare Flask vs. Django vs. FastAPI And also Go's Stdlib vs. Python's FastAPI
@Monkeydew1o2
@Monkeydew1o2 7 күн бұрын
Please do a higher level golang framework comparison. Like gin versus Chi
@AntonPutra
@AntonPutra 7 күн бұрын
ok
@FilipeASantana
@FilipeASantana 7 күн бұрын
Top heim, dublado em português Br. Aí sim eu dou valor.
@trap7369
@trap7369 5 күн бұрын
a dublagem é feature nova do youtube kkk, eu achei meio robótico, se não achou?
@seringturu
@seringturu 5 күн бұрын
What did you use to benchmark and making that graph?
@AntonPutra
@AntonPutra 5 күн бұрын
prometheus + grafana and i have a client that instrumented with metrics as well
@snatvb
@snatvb 6 күн бұрын
once again confirming that you are more likely to get stuck in a database than in the capabilities of your application :)
@awksedgreep
@awksedgreep 7 күн бұрын
Fastest Go web framework: Phoenix ;) Wait, you should totally test that theory. haha
@101kawsar
@101kawsar 7 күн бұрын
stdlib 😎💪
@AntonPutra
@AntonPutra 7 күн бұрын
yes it's great
@riskikukuh1293
@riskikukuh1293 6 күн бұрын
Hi Anton, can i run your test in my local machine ? Can you make video to tell us how to run your code / benchmark, thanks a lot
@AntonPutra
@AntonPutra 6 күн бұрын
sure you can source code in the description, i may include compose files in the future
@riskikukuh1293
@riskikukuh1293 6 күн бұрын
@AntonPutra i mean, you can explain how to run your benchmark 😅
@zhifong-gan
@zhifong-gan 5 күн бұрын
can u also test Hertz framework?
@AntonPutra
@AntonPutra 5 күн бұрын
yes i just forgot about it
@MusKel
@MusKel 7 күн бұрын
When Kafka vs Nats?
@himmetavsar2168
@himmetavsar2168 7 күн бұрын
Waiting for this one as well
@AntonPutra
@AntonPutra 7 күн бұрын
soon i promise
@fprotimaru1944
@fprotimaru1944 7 күн бұрын
@@AntonPutra this would be one of the best videos you ever made:)
@Nick-yd3rc
@Nick-yd3rc 7 күн бұрын
NATS is substantially slower, I’d rather watch Pulsar vs Rabbit vs Artemis. On various message sizes. It gets only interesting if you parameterize your message size. But all of them work best in clusters to serve concurrent workloads.
@carlos-rian
@carlos-rian 7 күн бұрын
The same for python please ☝🏼
@orafaelgf
@orafaelgf 7 күн бұрын
great video, tks.
@AntonPutra
@AntonPutra 7 күн бұрын
thanks!
@vasilekx8
@vasilekx8 6 күн бұрын
What about Gin and Chi?
@AntonPutra
@AntonPutra 6 күн бұрын
they are not optimized for performance
@zezohassam
@zezohassam 7 күн бұрын
Can you do spring boot vs Django
@UwU-f2a
@UwU-f2a 7 күн бұрын
obviously springboot win (JIT compilation, better runtime and garbage collector, better features). Django is pure python, no binding with performant library written in other languages, it doesnt even beat nodejs
@AntonPutra
@AntonPutra 7 күн бұрын
yes looks like a fair comparison from a functionality perspective
@mmadevgame
@mmadevgame 7 күн бұрын
@@UwU-f2a Sometimes it's just nice to see how fast or slow something is compared to something else
@Nick-yd3rc
@Nick-yd3rc 7 күн бұрын
Define Spring Boot. The defaults are fine but there’s a lot of knobs to tune it to your actual workloads. How much RAM, what stack size, blocking, virtual threads or reactive controllers and database?
@Grahamaan27
@Grahamaan27 7 күн бұрын
Imo, if a container is getting more than 20k req/s you should start scaling earlier
@AntonPutra
@AntonPutra 7 күн бұрын
true
@fedot_compot180
@fedot_compot180 6 күн бұрын
What about bun router?
@Teo-t9u
@Teo-t9u 7 күн бұрын
Prisma vs drizzle 😊
@AntonPutra
@AntonPutra 7 күн бұрын
ok will do
@IlyaShaforostoff
@IlyaShaforostoff 7 күн бұрын
@@AntonPutra please add sequelize to this comparison )
@AliResool-k8z
@AliResool-k8z 7 күн бұрын
Where is go gin?
@BarakaAndrew
@BarakaAndrew 7 күн бұрын
It wouldn't make sense since gin is a wrapper for stdlib, the performance would be the same as stdlib. Same goes for echo. They are all just stdlib with some fancy stuff built on top such as json parsing, context e.t.c
@AntonPutra
@AntonPutra 7 күн бұрын
yeah gin is on the same level as stdlib
@MilanRodd
@MilanRodd 7 күн бұрын
You forgot echo again ((
@AntonPutra
@AntonPutra 7 күн бұрын
i didn't want to disappoint you lol
@azulamazigh2789
@azulamazigh2789 7 күн бұрын
We demand HAproxy vs NGINX
@AntonPutra
@AntonPutra 7 күн бұрын
haha ok
@azulamazigh2789
@azulamazigh2789 7 күн бұрын
@@AntonPutra you are the best
@sumitftr
@sumitftr 7 күн бұрын
Please make: CouchDB vs MongoDB vs DynamoDB vs ScyllaDB vs FireStore
@nana.bxffour
@nana.bxffour 6 күн бұрын
Ummm how much does he earn? Those are big boxes
@AntonPutra
@AntonPutra 6 күн бұрын
yeah
@wwloyd
@wwloyd 7 күн бұрын
std lib is the way
@AntonPutra
@AntonPutra 7 күн бұрын
yes
@maximtheconqueror
@maximtheconqueror 6 күн бұрын
And... Rust is faster!!!
@AntonPutra
@AntonPutra 6 күн бұрын
rust is coming, will see
@trap7369
@trap7369 5 күн бұрын
@@AntonPutra waiting for more rust benchmarks, great job!
@markxavior
@markxavior 6 күн бұрын
You should gave included gin
@AntonPutra
@AntonPutra 5 күн бұрын
will do next time
@AchwaqKhalid
@AchwaqKhalid 7 күн бұрын
You forgot the following Frameworks: - Gin - Chi - Beego - Iris - Echo - ReveL Please do include these in your future video/s because Golang is apparently on high demand nowadays 👨🏻‍💻
@AntonPutra
@AntonPutra 7 күн бұрын
ok i'll include some of them
@revenity7543
@revenity7543 7 күн бұрын
GNet is not actually standard compliant
@AntonPutra
@AntonPutra 7 күн бұрын
it's not
@SilasDuarte-e9k
@SilasDuarte-e9k 7 күн бұрын
But it's Go
@revenity7543
@revenity7543 7 күн бұрын
@@SilasDuarte-e9k It's not a valid HTTP framework
@revenity7543
@revenity7543 7 күн бұрын
@@AntonPutra Are u agreeing with me or no
@michelvandermeiren8661
@michelvandermeiren8661 7 күн бұрын
So std is as good as fiber ? Soo many people say fiber is way faster
@AntonPutra
@AntonPutra 7 күн бұрын
It is faster at some point and has higher throughput
@jesusruiz4073
@jesusruiz4073 7 күн бұрын
Yes, fiber is way faster (see first test), but in typical database applications, it does not matter. A simple example: - HTTP handling time with Std is 1ms, and with fiber is 10x faster: 0.1ms - Business logic and DB operations: 99ms (it is the same independent of the framework). Total times: Std: 100ms, fiber: 99.9ms And normally, the difference is even less. However, when the time elapsed per request is mostly HTTP handling, the difference is apparent.
@news3951
@news3951 7 күн бұрын
Hello Brother Anton Putra 🥰🥰, Can you compare AWS S3, Cloudflare R2, azure blob storage , backblaze b2 storage and Google Storage ? .
@AntonPutra
@AntonPutra 7 күн бұрын
ok i'll think about it
Redis vs Dragonfly Performance (Latency - Throughput - Saturation)
12:51
This Video is AI Generated! SORA Review
16:41
Marques Brownlee
Рет қаралды 3 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,1 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 98 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 9 МЛН
Now I Know Why Most People Don’t Use gRPC
19:11
ArjanCodes
Рет қаралды 50 М.
Python (FastAPI) vs Go (Golang) Performance Benchmark
8:47
Anton Putra
Рет қаралды 7 М.
.NET and C# are in trouble. Here is what I'd do.
10:57
Ed Andersen
Рет қаралды 112 М.
Finally a Mac for This Economy - Mac Mini M4
13:44
Linus Tech Tips
Рет қаралды 1,2 МЛН
I built a REAL Desktop App with both Tauri and Electron
12:22
Bufferhead
Рет қаралды 61 М.
Go vs Rust vs Bun vs Node | Prime Reacts
18:07
ThePrimeTime
Рет қаралды 176 М.
The fastest CPU in the world
25:53
Linus Tech Tips
Рет қаралды 1,9 МЛН
MongoDB vs. PostgreSQL: Performance & Functionality
14:35
Anton Putra
Рет қаралды 31 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН