Go (Golang) vs. Bun: Performance (Latency - Throughput - Saturation - Availability)

  Рет қаралды 19,614

Anton Putra

Anton Putra

Күн бұрын

Пікірлер: 243
@AntonPutra
@AntonPutra 2 күн бұрын
► What should I test next? ► AWS is expensive - Infra Support Fund: buymeacoffee.com/antonputra ► Benchmarks: kzbin.info/aero/PLiMWaCMwGJXmcDLvMQeORJ-j_jayKaLVn&si=p-UOaVM_6_SFx52H
@ferdynandkiepski5026
@ferdynandkiepski5026 2 күн бұрын
When are we getting a comparison with C/C++? I would most like to see C++ vs Rust vs Go, as these are the options for high performance.
@AGAU1022
@AGAU1022 2 күн бұрын
Node vs Deno and/or Deno Fresh (real world test like Test 2 with Postgres or SQLite)
@AGAU1022
@AGAU1022 2 күн бұрын
I'd also like to see Test 2 for: single thread vs multi thread Bun the winner of Node vs Deno vs Go Axum vs Zig std library vs Go vs Loco F# (giraffe) vs C# (minimal API) Python (blacksheep) vs Lua (openresty) Julia (std lib) vs Julia (oxygen) vs Julia (jewlia)
@x31tr0n7
@x31tr0n7 2 күн бұрын
A performance overview of kafka vs pulsar vs nats vs rabbitmq vs activemq would be really great.
@suriyaprakashg7007
@suriyaprakashg7007 2 күн бұрын
FastAPI benchmark
@wisataakhirpekan
@wisataakhirpekan 2 күн бұрын
This match is the most anticipated by some viewers.
@Serizon_
@Serizon_ 2 күн бұрын
agreed
@PraiseYeezus
@PraiseYeezus 2 күн бұрын
they're really fun but it also seems like people are taking the results way too seriously
@AntonPutra
@AntonPutra 2 күн бұрын
😊
@Tom-mx1ec
@Tom-mx1ec 2 күн бұрын
Дякую за такий корисний контент! Вже почав вчити Go ;)
@AntonPutra
@AntonPutra 2 күн бұрын
my pleasure 😊
@ninjaasmoke
@ninjaasmoke 2 күн бұрын
this series is really good!!
@AntonPutra
@AntonPutra 2 күн бұрын
thank you!
@ferdynandkiepski5026
@ferdynandkiepski5026 2 күн бұрын
You are possibly missing optimizations with GO. You don't define a value for GOAMD64, which will default to v1. Apparently if the host has higher capability then it can generate assembly with other extensions, but I wouldn't rely on the compiler doing that. Go wiki->minimum requirements->microarchitecture describes the possible values for x86_64. On M7a, it looks like you have access to avx512, which means you could set GOAMD64=v4. Similar flags exist for other architectures. This could also reduce code size, as it would mean the compiler won't be relying on dynamic dispatch to generate the faster codepaths while leaving a compatibility version behind, which wastes space and is slower.
@howemeet
@howemeet 2 күн бұрын
There is also PGO (profile guided optimizations) in go and more agressive inlining optimizations to be enabled
@misalambasta
@misalambasta 2 күн бұрын
Raise the PR
@severgun
@severgun 2 күн бұрын
I can bet processing HTTP requests does not require vector extensions
@salamander_xing
@salamander_xing 2 күн бұрын
ok but i bet you can also optimize Bun
@germandavid2520
@germandavid2520 2 күн бұрын
Please raise a PR with the changes, Anton will merge your PR and make a new video if there is performance improvements.
@hohohomeboy
@hohohomeboy 2 күн бұрын
Thank you for your videos! I really like to watch, because the setup is very consistent and you make good distinctions, like in this video with the “synthetic” setup and a more real word setup.
@AntonPutra
@AntonPutra 2 күн бұрын
thanks! i do my best
@AGAU1022
@AGAU1022 Күн бұрын
Thanks for doing these, love them.
@공석원-v9b
@공석원-v9b 2 күн бұрын
elixir vs golang 🎉
@AntonPutra
@AntonPutra 2 күн бұрын
i remember 😊
@Mentioum
@Mentioum 2 күн бұрын
@@공석원-v9b elixir will be *much* slower. Benefits of elixir are it's developer ergonomics.
@katungiyassin9947
@katungiyassin9947 Күн бұрын
@@Mentioum And Elixir is not good with memory, it just drinks memory like water
@austinraney
@austinraney 2 күн бұрын
This result isn’t overly surprising. Bun is architected for environments where applications are running on a single CPU. Go is architected for running in environments with multiple CPUs. Constraining the tests to a single CPU is playing into buns court. The go runtime runs a separate cpu thread for network related syscalls. Other goroutines (each handler would get its own goroutine) could be running on one or more other cpu threads (goroutines are multiplexed onto the cpu threads by go’s runtime). The cost of switching between threads over a single cpu will be high and reduce performance.
@stxnw
@stxnw 2 күн бұрын
Bun can use workers. I doubt the results would change much. Bun is written in Zig afterall.
@AntonPutra
@AntonPutra 2 күн бұрын
thanks for the feedback
@austinraney
@austinraney Күн бұрын
@@stxnw yeah i’d be interested to see the results. For the first test, I would expect go to perform a bit better than it did in this sample as json marshaling shouldn’t contend as much with the thread conducting async network operations. But, I am a fool when it comes to the bun internals, so you are likely right!
@Mentioum
@Mentioum 2 күн бұрын
It's worth noting that in Golang, if you're optimizing for a scenario where you want to do this kind of test, you'd definitely not use the default json/marshal to return JSON, you're use string substitution / a template system. JSON marshalling is *extremely* cpu and memory intensive relatively speaking to something like quicktemplate. I havent benchmarked it for a long time, but from memory it was something like 10x better. If you know the structure of your json object and can build it with fasttemplate (almost always can) then you can save a *huge* amount of CPU usage, and increase application throughput. Great video though, the ¬40% CPU utilisation's effect on Go was fascinating and so easily avoidable with autoscaling. Incredibly interesting. I'll be adjusting my autoscaling triggers from 60% to 40% based on this.
@AntonPutra
@AntonPutra 2 күн бұрын
thank you for the feedback, I'll play with json sometime in the future
@therealgamingmaniac
@therealgamingmaniac 2 күн бұрын
Also Golang encoding/json is slow, use fast-json
@reneseses
@reneseses 22 сағат бұрын
Sonic is the fastest JSON library that I have tested and does not require making significant changes to the code. Also the project is active.
@gokulkrishnan7427
@gokulkrishnan7427 18 сағат бұрын
@@therealgamingmaniac Why fast-json is good in serialization than encoding/json ?
@DimasYudhaPratama-w4c
@DimasYudhaPratama-w4c 18 сағат бұрын
Great video. Hope you can make another video to compare between Bun with Elysia and Go with Fiber 👌
@AbegazNap
@AbegazNap 9 сағат бұрын
does elysia use a custom json parser?
@ilyastrelov9868
@ilyastrelov9868 2 күн бұрын
Thanks for doing such a wonderful work
@AntonPutra
@AntonPutra 2 күн бұрын
my pleasure, it's fun
@christianovergaard1081
@christianovergaard1081 2 күн бұрын
I think it would be nice if you did like a bigger benchmark once in a while to collect all your tests. So best rust, vs best go, vs django/fastapi (lol), etc.
@martinhotmann7868
@martinhotmann7868 2 күн бұрын
ABSOLUTELY!!! :) Also he should take not stdlib from golang, since it just is not so performant as fiber etc! And: more cores ... really today cores are cheap and people that would care about such type of performance, at least run on 4 cores. Single core is just not realistic today anymore.
@BosonCollider
@BosonCollider 2 күн бұрын
@@martinhotmann7868 Stdlib router was more than good enough when the requests have to do actual work.
@severgun
@severgun 2 күн бұрын
just check final values and compare them in your mind or google spreadsheet. You can compare 3 values without youtube video
@AntonPutra
@AntonPutra 2 күн бұрын
yes, I will do that as soon as I standardize the tests and optimize the infrastructure
@katungiyassin9947
@katungiyassin9947 Күн бұрын
@@christianovergaard1081 I like to see Erlang go against Rust, because Erlang's BEAM is hyped for it's concurrency. Don't you think that will be worth being the benchmark of the Century?
@lemna9138
@lemna9138 2 күн бұрын
Probably what is happening is that the bun.serve({static: {...}}) only interprets the js object once while the dynamic tests must run javascript every single request. I guess bun.serve static is a very convenient api for their static zig server
@AntonPutra
@AntonPutra 2 күн бұрын
maybe you're right
@MelroyvandenBerg
@MelroyvandenBerg 2 күн бұрын
@@AntonPutra testing is easy, creating a good test is hard.. Creating a fair test is even harder.
@diosupremo4928
@diosupremo4928 2 күн бұрын
What I learn with this channel: If you need to build a performant web server use Go
@Александр-ф9в4ю
@Александр-ф9в4ю 2 күн бұрын
Yes, you use Rust
@artemxyi
@artemxyi 2 күн бұрын
​@@Александр-ф9в4юyou should use, учите инглиш
@AntonPutra
@AntonPutra 2 күн бұрын
rust is also an option
@LuarVik-x1l
@LuarVik-x1l 2 күн бұрын
@@artemxyi Все зрители данного видео, так же как и его автор, оказались русскими, скрывающими свое происхождение.
@cesarmartinez2207
@cesarmartinez2207 2 күн бұрын
​​@@AntonPutra True, but the learning curve between rust and go it's insane, even you needed a second video with rust to optimize to beat go but with go on the other hand, you can get things done fast and easy
@TsillALevi
@TsillALevi 2 күн бұрын
After went through so much compare between programing language. What do you think about making a video compare between database especially recently PostgreSQL 17 release and MySQL have major update to version 9. Thks.
@AntonPutra
@AntonPutra 2 күн бұрын
yes mysql 9.0.1 vs postgres 17.0.1 coming next
@jevve11er
@jevve11er 2 күн бұрын
​@@AntonPutra Don't forget MongoDB, RavenDB YugabyteDB, DuckDB with Go pls
@MelroyvandenBerg
@MelroyvandenBerg 2 күн бұрын
Thanks for the Golang vs Bun !
@AntonPutra
@AntonPutra 2 күн бұрын
my pleasure, deno is coming soon as well
@user-ow8gw8nl6p
@user-ow8gw8nl6p 18 сағат бұрын
🔥​@@AntonPutra
@GabrielPozo
@GabrielPozo 2 күн бұрын
Great video!!! 👏👏👏
@tghpereira
@tghpereira Күн бұрын
A comparison between go and c++ would be interesting
@AntonPutra
@AntonPutra Күн бұрын
will do!
@conundrum2u
@conundrum2u 2 күн бұрын
If you're serving static content you're really just going to use a CDN or service that is optimized for it. Scenario #2 is far more illustrative. When we're talking microseconds difference in latency, it's more likely that other network factors will mask it from the client's perspective so I think it's a non-issue. Good video
@AntonPutra
@AntonPutra 2 күн бұрын
agreed
@danielnascimento4577
@danielnascimento4577 2 күн бұрын
This kind of video is awesome!! Tks for This.
@AntonPutra
@AntonPutra 2 күн бұрын
thank you!
@amiteshgupta8404
@amiteshgupta8404 2 күн бұрын
Thanks for such a good comparison video.
@AntonPutra
@AntonPutra 2 күн бұрын
my pleasure
@colin_actually
@colin_actually Күн бұрын
Very interesting. Need a table summarizing where each solution's relative strengths and weaknesses are. Golang pretty good overall.
@elvispalace
@elvispalace 2 күн бұрын
non-blocking I/O is great to handle request. but when you need to parse alot data, JS pushes the CPU, there is where GO shows it supremacy. maybe in the future, with a runtime using Static Hermes (a JS static compiler x10 times faster than actual engines), JS will be better in handle with this problem
@AntonPutra
@AntonPutra 2 күн бұрын
ok thanks, i'll test it when available
@andreujuanc
@andreujuanc 2 күн бұрын
Oh wow, WTF! UNEXPECTED!!!!
@AntonPutra
@AntonPutra 2 күн бұрын
i expected this after i ran Bun vs Node.js 😊
@ahmedsat4780
@ahmedsat4780 2 күн бұрын
great videos 💯💯
@AntonPutra
@AntonPutra 2 күн бұрын
thanks!
@edgonn
@edgonn 2 күн бұрын
Bun already comes pre-configured with optimization features that were not used in Go. Use goroutine to get closer to what is already offered in Bun's standard architecture.
@AntonPutra
@AntonPutra 2 күн бұрын
What do you mean by use goroutine in this context? Can you give me an example or PR?
@ruannawe6157
@ruannawe6157 21 сағат бұрын
Nice vídeo! Do you have some documentation how to deploy the benchmarks that you do in your vídeos?
@farhadeviltrg6116
@farhadeviltrg6116 2 күн бұрын
Good content 👌 Do fastapi vs go too
@AntonPutra
@AntonPutra 2 күн бұрын
thanks! i'll do python fastapi soon
@toTheMuh
@toTheMuh 2 күн бұрын
Bun could be useful as a background worker. Imagine you have a go api which contains some functionalities with cpu heavy calculation that do not need to access a database. You could outsource that part of the your go api to a bun server which does the calculation and returns the result.
@skuwamy
@skuwamy 2 күн бұрын
imagine using javascript in backend hahahahahahah
@AntonPutra
@AntonPutra 2 күн бұрын
i think if you're a frontend developer, you can probably find a use case for bun, just to keep your codebase in the same language
@Justsomeguy492
@Justsomeguy492 2 күн бұрын
please benchmark spring boot with virtual threads
@AntonPutra
@AntonPutra 2 күн бұрын
I'll work on Java in a bit
@uptownhr
@uptownhr 23 сағат бұрын
Did not expect this. How about a deno vs bun?
@marufhasan3782
@marufhasan3782 2 күн бұрын
We need springboot with virtual threads vs go.
@AntonPutra
@AntonPutra 2 күн бұрын
i remember 😊
@svrd-tech
@svrd-tech Күн бұрын
​@@AntonPutra Spring boot app with virtual threads, webflux and compiled with graalvm :)
@alissonprimo
@alissonprimo 2 күн бұрын
Elixir vs All the others
@-foxy1859
@-foxy1859 2 күн бұрын
i think since Erlang type langs run in beam they will have worse performance. But they can scale at ease. Id also like to see benchmarks
@infantfrontender6131
@infantfrontender6131 2 күн бұрын
@@-foxy1859, you can use Rustler or Elixir NX for better performance, but it's too much. BEAM is about scale, concurrency, and fault tolerance
@AntonPutra
@AntonPutra 2 күн бұрын
will do Elixir afte database benchmark
@avayema
@avayema Күн бұрын
Please compare Fiber vs Bun
@AntonPutra
@AntonPutra Күн бұрын
i'll do it but probably later
@SilasDuarte-e9k
@SilasDuarte-e9k 2 күн бұрын
Bun is basically Zig, so great performance is expected. But, Bun is a dependency and Go is a single binary without dependencies. So, it's basically Zig vs Go. And the two languages are great. Good comparison!
@commonfolk663
@commonfolk663 2 күн бұрын
What does that even mean tho? Bun is bascially Zig the same way NodeJs is basically C++.
@AntonPutra
@AntonPutra 2 күн бұрын
😊
@eightc3370
@eightc3370 2 күн бұрын
It's clear you don't fully understand the difference among Javascript, Go and Zig. Saying Bun is 'basically Zig' and comparing it to Go really overlooks how programming languages work. Zig is a systems programming language with low-level memory management, while Bun is a JavaScript runtime built using Zig to optimize JS performance. Comparing Go and Zig doesn’t make sense because they solve very different problems-Go is designed for web services, concurrency, and backend development, while Zig focuses on systems-level control. These languages operate in entirely different ecosystems, so it’s not an apples-to-apples comparison.
@garretmh
@garretmh Күн бұрын
I think what the OP trying to say is that since bun's internals are implemented in Zig, in a simple test like the first one most of the executed code is Zig and not JavaScript.
@giorgio5127
@giorgio5127 2 күн бұрын
I am curious about Swift 6 with hammingbird 2
@AntonPutra
@AntonPutra 2 күн бұрын
ok noted
@salim444
@salim444 2 күн бұрын
Can you please do Clojure (reitit) vs go? the bun vs go was unexpected but that is why testing is crucial
@AntonPutra
@AntonPutra 2 күн бұрын
ok noted
@SkylearJ
@SkylearJ 2 күн бұрын
Reading the comments on every video, I think people miss the point. If you have to take a bunch of extra steps to achieve max optimization, that is inherently a lesser experience than something that works fast and well out of the box. Just because Go has some esoteric optimizations you can use, doesn't mean everyone will know they even exist. Bun is therefore a better ootb experience.
@AntonPutra
@AntonPutra 2 күн бұрын
well, if you're a frontend developer with javascript experience, it's much easier to maintain the codebase using the same language
@commonfolk663
@commonfolk663 2 күн бұрын
​@@AntonPutra you probably mean isomorphic codebase, frontenders could use types from Typescript backend directly, without having to rely on tools like Swagger to expose backend API. But TS-Node/Bun backend is much harder to learn than Golang even with frontend-js background, for anyone whos looking to develop simple but performant backend, Golang is a much better fit. Typescript is just outright better for business logic than Go on the other hand, fully capable of utilizing OOP and FP patterns, having higher level of control over threading, making it suitable for managing other services. I think biggest advantage Go has over Bun/Node isnt necessarily speed, but how easy it is not to mess up. In Go you can pretty much throw goroutines at anything and Go will automagically make sure it avoids blocking. In NodeJS/Bun on the other hand, its one of the biggest problems in community and backend development, as poor understanding of EventLoop and Worker-Threads leads to blocking and therefore insufferable performance JS is rumored for.
@assorium
@assorium Күн бұрын
It's not that isoteric, this is why backend is it's own thing. There are CPU architectures and other hardware to keep in mind. It is true though, that some languages and runtimes help optimizing but they cannot physically optimize code for every use case and hardware combinations. In the end all these comparisons are 10-20% useful, mostly showing how far actually hardware went ahead rather languages. Serving 20k dynamic request from a couple of nodes would be quite insane 10 years ago. And I'm not completely agree that knowing same language helps with DX, as language is just 1 step in the field of huge amount other knowledge required to maintain that end.
@RishabhBahukhandi
@RishabhBahukhandi 2 күн бұрын
I wonder how good nextjs APIs are as compared to a proper server using express
@AntonPutra
@AntonPutra 2 күн бұрын
i'll test next.js in the near future
@RishabhBahukhandi
@RishabhBahukhandi 2 күн бұрын
@@AntonPutra thanks 👍🏼
@boot-strapper
@boot-strapper 2 күн бұрын
unfortunately for tests like these its really hard to judge a language. For example, bun's built in sqlite is godly performance. Some of the drivers that bun is compatible with, are not really optimal for bun. I suspect thats the case with mongo driver here. Thanks again, nice work
@AntonPutra
@AntonPutra 2 күн бұрын
well, sqlite is not for production, it’s just a local database for testing. i’ve already tested bun with postgres and mongo, and the results are the same so far
@boot-strapper
@boot-strapper 2 күн бұрын
@@AntonPutra fair. I do think it will get better over time. But SQLite can be used for production actually, and there are even new tools around using distributed SQLite
@zedd7682
@zedd7682 2 күн бұрын
i think a benchmark returning html instead json (htmx) could be cool too
@AntonPutra
@AntonPutra 2 күн бұрын
i'll get to UI soon, like react and angular, but I don't really see the benefit of testing server-side rendering
@denisuardi3979
@denisuardi3979 Күн бұрын
please do go vs php, because i wanna explain to my company about how good golang
@robcannon
@robcannon 2 күн бұрын
I would like to see Deno vs Bun. I would also like to see the C# vs Go again now that you are using Go stdlib. Although, maybe you should wait for .Net 9.0 since this being release next month.
@AntonPutra
@AntonPutra 2 күн бұрын
i'll wait. also, deno v2 is not officially out yet either
@victormadu1635
@victormadu1635 2 күн бұрын
Pls can you do database performance benchmarking
@AntonPutra
@AntonPutra 2 күн бұрын
yes coming next
@TheOchita
@TheOchita 2 күн бұрын
Isn't test1 just testing how good the buildin json lib is? My guess would be that the bun json is either being jitted to really good optimal code or it's using a c++ biding. On the good side it's well known that v1 isn't fast, which is why they are msking v2.
@AntonPutra
@AntonPutra 2 күн бұрын
I guess, but many benchmarks use static tests, which is why I include them
@ebuzertahakanat
@ebuzertahakanat Күн бұрын
would you re create go vs java benchmark please because as you know you didn't push them to the limit with the video that currently published.
@katungiyassin9947
@katungiyassin9947 Күн бұрын
I like to see Erlang go against Rust, because Erlang's BEAM is hyped for it's concurrency. Don't you think that will be worth being the benchmark of the Century?
@mridu299
@mridu299 2 күн бұрын
Request for two new items. First explaining these metrics and second fastapi vs go really want to see how the results will be.
@AntonPutra
@AntonPutra 2 күн бұрын
ok got it, i'll do fastapi (python) soon
@hughesabsalom526
@hughesabsalom526 2 күн бұрын
Lesson learnt, no company runs on static data 😅😅
@AntonPutra
@AntonPutra 2 күн бұрын
💯
@szymmarcinkowski
@szymmarcinkowski 12 сағат бұрын
These benchmarks should not be taking too serious as that is still clearly too simple thus far from real life applications to provide real insights.
@therceman
@therceman 2 күн бұрын
Deno 2 vs go 😀 Or Bun with framework vs go Lang framework
@yume6643
@yume6643 2 күн бұрын
what framework ? There is no use of a framework in go
@therceman
@therceman 2 күн бұрын
@@yume6643 are you sure about that? 😀
@AntonPutra
@AntonPutra 2 күн бұрын
waiting for the official release of v2, so far, Deno only has a release candidate
@yume6643
@yume6643 Күн бұрын
@@therceman well, give me one reason to use a framework over the stdlib?
@timvw01
@timvw01 2 күн бұрын
C++ vs rust?
@AntonPutra
@AntonPutra 2 күн бұрын
i'll get to c++ soon
@settiricardo
@settiricardo 2 күн бұрын
that's unexpected,
@AntonPutra
@AntonPutra 2 күн бұрын
i expected this after i ran Bun vs Node.js 😊
@yaminokaze4475
@yaminokaze4475 2 күн бұрын
So when doing any real work go is better?
@AntonPutra
@AntonPutra 2 күн бұрын
yes
@kal.leroux
@kal.leroux 2 күн бұрын
I think it's better to have 1 instance with 2 core than 2 instances with 1 core for golang case or you can make a video about it
@AntonPutra
@AntonPutra 2 күн бұрын
I'll test it, but I use 2 instances to match Bun's setup, since it runs on a single thread
@kal.leroux
@kal.leroux 2 күн бұрын
@@AntonPutra I understand it's just that if golang perform better in multiple core env than multiple instance with single than your test would be a little bit misleading but I understand that we always use multiple instance when deploying app even in golang so I don't know, anyway I like your content and keep going
@dtesta
@dtesta Күн бұрын
You should probably have chosen sqlite3 instead, as Bun is optimised for it.
@sanchitwadehra
@sanchitwadehra 2 күн бұрын
dhanyavad
@Serizon_
@Serizon_ 2 күн бұрын
Lmao seeing a indian in the chat is good
@AntonPutra
@AntonPutra 2 күн бұрын
my pleasure 😊
@0xd3c0d3d
@0xd3c0d3d Күн бұрын
Zig shining through the BUN 😁
@truongan354
@truongan354 2 күн бұрын
Again with sqlite please
@AntonPutra
@AntonPutra 2 күн бұрын
sqlite is used only for development, it is not a real database
@truongan354
@truongan354 2 күн бұрын
@@AntonPutra I use sqlite for huge data of farms. It is very fast
@abinesh-devadas
@abinesh-devadas Күн бұрын
Can you do java (springboot) vs node (nestjs)
@archyt88
@archyt88 Күн бұрын
Give it a try to python sanic, it is really fast
@marcosAmaranteC
@marcosAmaranteC 2 күн бұрын
Guys, what do you think about GORM, for a long time I preferred to use pgx and write my queries manually, but I've been using gorm for a week on a small project and I'm really enjoying it. although it is very far from being a LINQ
@nguyennguyenkhang5800
@nguyennguyenkhang5800 2 күн бұрын
Meh, I found ORM really sucks if project grew up with a complex queries can make it slow overtime and try pretend your programming code is better than SQL. If you have time and you know SQL just dive in to SQL and write SQL procedure or function. It is easier for me to switch to other backend programming or write unit test in the future in case I don't like Go and switch to Rust. But that is just my personal opinion if I have to work with SQL.
@khawarizmyana
@khawarizmyana 2 күн бұрын
Sqlc
@mad_t
@mad_t 2 күн бұрын
gorm is good for read tasks I use gorm to read and pgxpool to insert/update/delete
@AntonPutra
@AntonPutra 2 күн бұрын
🧐
@ibrahimnalbant7635
@ibrahimnalbant7635 2 күн бұрын
can you do python vs bun vs node?
@AntonPutra
@AntonPutra 2 күн бұрын
i'll do python soon (faastapi)
@SamerLOLOfficial
@SamerLOLOfficial 2 күн бұрын
Maybe next time use Honojs or Elysiajs for Bun, since it handle HTTP requests better.
@AntonPutra
@AntonPutra 2 күн бұрын
thanks i'll get to Elysiajs soon
@katungiyassin9947
@katungiyassin9947 Күн бұрын
If Bun has managed to be this good, I think now you see where Zig is going. Soon Zig is coming for your Rust....
@yedidyarashi
@yedidyarashi 2 күн бұрын
I see that you using aputra/load-tester:v18 to run the tests where can I find the docker file for it?
@AntonPutra
@AntonPutra 2 күн бұрын
i need to refactor it before i can release it, it's just a rust client with prometheus metrics
@yedidyarashi
@yedidyarashi 2 күн бұрын
@@AntonPutra awaiting for your update
@chielonewctle7601
@chielonewctle7601 Күн бұрын
hmm, that red-eyed jealous gopher...
@RandyRanderson404
@RandyRanderson404 2 күн бұрын
Why is the gopher stoned in the thumbnail?
@AntonPutra
@AntonPutra 2 күн бұрын
😂
@yume6643
@yume6643 2 күн бұрын
So basically, what does this benchmark shows us : unoptimized Golang nerfed to 1 core + pure go json lib is not far from a zig json implementation; "real world" nerfed golang is much better than bun. 2-0 for golang against zigscript. 😀
@AntonPutra
@AntonPutra 2 күн бұрын
not sure what you mean by not optimized
@Dipj01
@Dipj01 2 күн бұрын
That's a lot of cope
@yume6643
@yume6643 Күн бұрын
@@AntonPutra did you compile it with pgo and optimization flags? Have you done a string format instead of the stdlib json which is known for low performances? Did you tune the gc ? Golang offers a lot of easy lower level optimization that doesn't need much work. 😊
@biLLie_wiLLie
@biLLie_wiLLie 2 күн бұрын
Do you really know all programming languages and tools?
@mad_t
@mad_t 2 күн бұрын
I don't think so. That's why he gives a repo link so ppl can make PRs if they want to optimize something
@AntonPutra
@AntonPutra 2 күн бұрын
I can handle basic tasks in most languages, but I heavily rely on expert advice and optimizations to improve performance
@ИнтернетСпасётМир
@ИнтернетСпасётМир 2 күн бұрын
I'm curious, how much does it approximately cost to run load benchmarks in large instances of AWS EKS for 2 applications with 2 replicas each for 2 hours?
@AntonPutra
@AntonPutra 2 күн бұрын
best case $10, worst case $50 and if you forget to tear down after test $200 😊
@ИнтернетСпасётМир
@ИнтернетСпасётМир Күн бұрын
@@AntonPutra Am I correct in understanding that the cost of an experiment can only be known at the end of the month when the bill is issued, or is it possible to find out earlier on Amazon, for example, the next day? I think many subscribers, including myself, would be very interested if you made an overview video about the costs of your test runs that we see on the channel. This could be an idea for your new videos - evaluating the financial aspect of your launches on Amazon.
@crazycode2578
@crazycode2578 2 күн бұрын
I wanna tag Web dev cody here!!!!
@AntonPutra
@AntonPutra 2 күн бұрын
😀
@mycode0
@mycode0 2 күн бұрын
Elixir vs go
@AntonPutra
@AntonPutra 2 күн бұрын
Noted, I'll do it after the database test
@O...Maiden...O
@O...Maiden...O 2 күн бұрын
bun & zig is just hype from ziguana, nothing more
@AntonPutra
@AntonPutra 2 күн бұрын
maybe, but I got a few PRs with Zig optimizations, will see
@reinettetinekerr219
@reinettetinekerr219 Күн бұрын
I see no elixir
@SR-ti6jj
@SR-ti6jj 2 күн бұрын
What do you make of the very last graph (CPU throttling)? Seems like Bun dipped below Go near the end of the test
@AntonPutra
@AntonPutra 2 күн бұрын
Not sure, I need to investigate, but it does correlate with high latency
@lordxan1
@lordxan1 2 күн бұрын
Bun vs rust (axum) next
@O...Maiden...O
@O...Maiden...O 2 күн бұрын
great, but no chance for bun when compared to rust, similar to recent benchmark between rust (actix) and zig (zap)
@AntonPutra
@AntonPutra 2 күн бұрын
bun can win in static tests, but if I add any dependency like a database or S3, it will fail
@toidihocdao-ux7ft
@toidihocdao-ux7ft 2 күн бұрын
what aboout deno vs golang
@AntonPutra
@AntonPutra 2 күн бұрын
waiting for the official release of v2, so far, Deno only has a release candidate
@martinhotmann7868
@martinhotmann7868 2 күн бұрын
Same as with node .. since node and bun are shit, we need to limit golang aswell - to make it "comparable", but the real world is: no one ever would do so. I really dislike it for multiple reasons: 1. golang performs bad with cpu limitations other than on a core base 2. golang is multicore - everytime you limit it to 1 core/thread, please also benchmark using 4 cores/threads etc.. other than this the viewer gets a limited picture. I understand, that other programming languages do not have good multi-core/parallelism implementations, but keep in mind, that you just wipe away golang biggest feature and then you compare it .. not fair!
@commonfolk663
@commonfolk663 2 күн бұрын
Real world lol, what do you know about real world? These tests compare I/O bound HTTP servers, not arbitrary multi-core calculations. I/O bound servers have absolute priority on horizontal scaling, for geo/load distribution across clusters. Core-count is vertical scaling model. Go's biggest feature "in real world" is its simplicity, especially when it comes to throwing Goroutines at anything without 2nd thought. As soon as you have spare time and resources, there's little reason to tolerate GC, lack of control over concurrency, horrendous typing system, incapable of processing puny jsons without breaking a neck, all while its still far from fastest languages and with lacking ecosyst
@AntonPutra
@AntonPutra 2 күн бұрын
thanks! i get your point. i'll do a separate benchmark with Node cluster mode and Go without that limit.
@eightc3370
@eightc3370 2 күн бұрын
@@commonfolk663 You raise some solid points about benchmarking, but the video comparing Bun.js and Go in single-core tests actually reveals a deeper insight into both frameworks' real-world performance. Here's why Go is still in a different class for most backend systems: I/O-Bound Performance: While Bun.js performed impressively in handling static requests in the single-core test, it started struggling when real-world workloads, such as database interactions, were introduced. In these scenarios, Go’s Goroutines shine, providing lower latency and much more efficient CPU usage when handling requests that involve persistent storage (like MongoDB). Go’s multicore concurrency allows it to distribute tasks more efficiently across threads, which is crucial when scaling up systems in production​. Latency vs. Throughput: The benchmark clearly shows that Go outperforms Bun.js in terms of latency up until the CPU reaches about 40% usage. For client-facing applications that prioritize low-latency, Go provides much faster response times under typical load. Bun.js may handle higher throughput at extreme loads, but as CPU usage increases, its single-threaded architecture causes latency to spike. Real-World Scenarios: The second test, which included MongoDB interactions, is where Go’s superiority becomes apparent. Go handled complex, real-world tasks-such as UUID generation and database inserts-far more efficiently than Bun.js. In real-world applications that require more than just static responses, Go’s ability to handle concurrency and persistent data operations is crucial​. Kubernetes & CPU Throttling: Both Bun.js and Go experienced CPU throttling under heavy loads in Kubernetes, but Go’s performance degraded less drastically. This is important when designing systems that operate under consistent load in production. Go’s ability to handle such scenarios means it’s better suited for long-running, scalable backend services. Multicore Efficiency: While the benchmark limited both Bun.js and Go to single-core usage, Go’s multicore capabilities are where it truly excels. Unlike Bun.js or Node.js, which are limited to single-threaded event loops, Go can fully utilize multiple cores to execute tasks in parallel, giving it a significant advantage in systems that require true parallelism Bun.js certainly has its strengths for static or synthetic benchmarks, but Go’s power is undeniable when it comes to real-world scenarios like handling databases and processing concurrent I/O-heavy tasks. For high-performance backends, Go still stands as the better choice in terms of latency, concurrency, and scalability.
@eip408
@eip408 2 күн бұрын
holy
@AntonPutra
@AntonPutra 2 күн бұрын
😊
@abiiranathan
@abiiranathan 2 күн бұрын
Where is Jarred?
@AntonPutra
@AntonPutra 2 күн бұрын
?
@RustIsWinning
@RustIsWinning Күн бұрын
Baldie is in his office fixing segfaults.
@ebuzertahakanat
@ebuzertahakanat Күн бұрын
also maybe it is just Bun's mongo driver sucks
@commonfolk663
@commonfolk663 2 күн бұрын
Go backenders angry this time. What if people find out that backend server that takes 1 week to learn isnt worth paying salaries for. Fear not, you can always start learning OOP and FP to begin your programmer education.
@AntonPutra
@AntonPutra 2 күн бұрын
😊
@hendrywilliam
@hendrywilliam Күн бұрын
What language do you prefer then?
@commonfolk663
@commonfolk663 Күн бұрын
@@hendrywilliamI'm an architect/manager in enterprise, I don't really think about it that way. Golang is wonderful for a lot of things, we do CLI and CI tools with it and backend for mvps, Golang is easiest to find middle+ developers for and I absolutely adore Nats, which is built on go. But id never propose Golang for backend of our projects if it has anywhere more than 2 developers on it. Golang is best for code that you never need to read and where you don't have any specific expectations for code, other than "just work". So for preferred language, it would depend on use-case, generally it's Rust/Java/Node for backend. Rust/C++ for high load. C++/Zig/Rust for system. Go/Python for CLI. Id say rust is universal right now. But it's too hard to find devs
@davidsiewert8649
@davidsiewert8649 2 күн бұрын
TLDR: Go uses 2x less memory and has 2x more RPS than Bun under the same hardware/kubernetes constrains
@AntonPutra
@AntonPutra 2 күн бұрын
well for the 2nd test only
@davidsiewert8649
@davidsiewert8649 2 күн бұрын
The first test with only static data/responses seems overly synthetic and completely useless to me since I would use a CDN + S3 storage for static files instead.
@hamm8934
@hamm8934 2 күн бұрын
Just say it: you made this video for all the js andys that dont wanna accept for some reason that there are better languages for the server, even languages with comparably easy syntax. Just say it lol.
@StingSting844
@StingSting844 2 күн бұрын
But the video is based on numbers??
@AntonPutra
@AntonPutra 2 күн бұрын
i'm just a devops, people ask, and I test
@tanko.reactions176
@tanko.reactions176 2 күн бұрын
with this one, all the fake devs (js guys) will feel justified and a reason for their existence. good for you for throwing them a piece of bread!
@EdwinMartin
@EdwinMartin 2 күн бұрын
Are go programmers really this childish?
@immer5680
@immer5680 2 күн бұрын
such an ignorant take, no need to be so insecure about your language of choice, it's just a piece of technology
@AntonPutra
@AntonPutra 2 күн бұрын
i don't have any bias, I'm just a devops engineer who runs code in production
@skuwamy
@skuwamy 2 күн бұрын
I wonder what these JS Dev Kiddies will suggest to benchmark now haha
@sdprolearning
@sdprolearning 2 күн бұрын
Ur mother
@AntonPutra
@AntonPutra 2 күн бұрын
deno v2 😊
@LegendaryLLama-hz8db
@LegendaryLLama-hz8db 2 күн бұрын
and to think i use to take these videos as accurate. You are missing a bunch of optimizations in golang. cant take this seriously lol
@EdwinMartin
@EdwinMartin 2 күн бұрын
Anton specifically asks for test improvements, so you’re free to give it to him.
@AntonPutra
@AntonPutra 2 күн бұрын
I got a lot of optimizations in the past for Go. If you have any advice, please share or, even better, create a PR.
Hacking Microsoft BASIC
18:03
Ben Eater
Рет қаралды 77 М.
SHAPALAQ 6 серия / 3 часть #aminkavitaminka #aminak #aminokka #расулшоу
00:59
Аминка Витаминка
Рет қаралды 2,6 МЛН
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 87 МЛН
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,9 МЛН
Крутой фокус + секрет! #shorts
00:10
Роман Magic
Рет қаралды 30 МЛН
People said this experiment was impossible, so I tried it
34:49
Veritasium
Рет қаралды 3,2 МЛН
The Ladybird browser is replacing C++ with... Swift?
4:54
Changelog
Рет қаралды 14 М.
When Outsourcing $9/hr Software Engineers goes Wrong
14:01
Coding with Dee
Рет қаралды 37 М.
Nix is my favorite package manager to use on macOS
28:08
Dreams of Autonomy
Рет қаралды 11 М.
How are holograms possible?
46:24
3Blue1Brown
Рет қаралды 439 М.
How To Structure Terraform Project (3 Levels)
41:21
Anton Putra
Рет қаралды 11 М.
SHAPALAQ 6 серия / 3 часть #aminkavitaminka #aminak #aminokka #расулшоу
00:59
Аминка Витаминка
Рет қаралды 2,6 МЛН