Go vs. Rust: Performance Benchmark

  Рет қаралды 156,682

Anton Putra

Anton Putra

Жыл бұрын

🔴 - To support my channel, I’d like to offer Mentorship/On-the-Job Support/Consulting - me@antonputra.com
▬▬▬▬▬ Experience & Location 💼 ▬▬▬▬▬
► I’m a Senior Software Engineer at Juniper Networks (12+ years of experience)
► Located in San Francisco Bay Area, CA (US citizen)
▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬
► LinkedIn: / anton-putra
► Twitter/X: / antonvputra
► GitHub: github.com/antonputra
► Email: me@antonputra.com
▬▬▬▬▬▬ Related videos 👨‍🏫 ▬▬▬▬▬▬
👉 [Playlist] Kubernetes Tutorials: • Kubernetes Tutorials
👉 [Playlist] Terraform Tutorials: • Terraform Tutorials fo...
👉 [Playlist] Network Tutorials: • Network Tutorials
👉 [Playlist] Apache Kafka Tutorials: • Apache Kafka Tutorials
👉 [Playlist] Performance Benchmarks: • Performance Benchmarks
👉 [Playlist] Database Tutorials: • Database Tutorials
▬▬▬▬▬▬▬ Source Code 📚 ▬▬▬▬▬▬▬
► GitHub: github.com/antonputra/tutoria...
#Rust #Golang #DevOps

Пікірлер: 323
@AntonPutra
@AntonPutra 9 ай бұрын
🔴 - To support my channel, I’d like to offer Mentorship/On-the-Job Support/Consulting - me@antonputra.com
@andizumko8860
@andizumko8860 Жыл бұрын
as you've rightly noted - it's more about comparing gin vs rocket, than rust vs go, but still, thanks, quite insightful
@AntonPutra
@AntonPutra Жыл бұрын
well except fibonacci
@shifteleven
@shifteleven Жыл бұрын
@@AntonPutra My other comment disappeared, but the fibonacci algorithms aren't the same. The Rust algorithm handles a few other cases that when I add that same logic to Go, the Go implementation runs in half the time.
@AntonPutra
@AntonPutra Жыл бұрын
@@shifteleven Thanks, I got your point
@ko-Daegu
@ko-Daegu Жыл бұрын
This shows nothing yes go is slower than rust nothing new but 80 is such a big no no this test is not accurate at all
@shifteleven
@shifteleven Жыл бұрын
I added this to a comment of a comment, but thought I would add here. The Fibonacci implementations are not the same for your Go code and your Rust code. Your rust code does extra checking to avoid extra recursion calls. In my local testing, I can speed up Go's fibonacci implementation by like 50% just by using the same algorithm that you use in the Rust code. Also, I can further improve the Go code for fibonacci where it's blazing fast if I rewrite the recursive function such that it can make use of tail call optimizations. I get it's there to artificially simulate load, but I wouldn't want someone's conclusion to be that "Oh man, Go under load is 80% worse than Rust!" when it's a case of this artificial function. All of this is to say, I don't disagree with your thesis statement that Rust is more performant that Go. Rust just is faster when it's time to run code when all things are considered equal, especially now with async/await.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks ShiftEleven for the feedback!
@oscarpinochet
@oscarpinochet Жыл бұрын
also i don't see a json serialization in the rust code for post method. in go code you are making a json serialization on post method with c.JSON.
@tuV13ja
@tuV13ja Жыл бұрын
I knew there was something like that haha Thanks! Now I don't need to check the code 🤣
@BulbaWarrior
@BulbaWarrior Жыл бұрын
Fibonacci functions are not even mathematically equivalent e.g. rust_fib(n) == go_fib(n) does not hold for all values of n since go uses 0 and 1 for the base case, while rust uses 1 and 2. Because of that rust version will also overflow/panic on fib(0), not a rusty way at all. Rust is a wonderful language indeed, but can we please prove it with proper science
@AlexanderKrivacsSchrder
@AlexanderKrivacsSchrder Жыл бұрын
@@oscarpinochet Rocket's Json type used in the handler automatically serializes. This is something basically every web framework in Rust offers as a return type in handlers.
@AntonPutra
@AntonPutra Жыл бұрын
❤Go (Golang) vs Java: kzbin.info/www/bejne/bnTMdqWCrcmUd5o ❤Go (Golang) vs Node JS - kzbin.info/www/bejne/pKWwfIGierh2pq8 ❤AWS Lambda Go vs. Node.js - kzbin.info/www/bejne/oXuXmJmlmpyahrM ❤AWS Lambda Python vs. Node.js - kzbin.info/www/bejne/eJCygJyja72lf5Y
@AntonPutra
@AntonPutra Жыл бұрын
❤Performance Benchmarks Playlist - kzbin.info/aero/PLiMWaCMwGJXl-h2RgOSpdO-pQaSRwlVjd
@Kumar-co1bp
@Kumar-co1bp Жыл бұрын
I appreciate your effort in making and publishing this video. I appreciate the way you compared.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Uday!
@alimoussa5037
@alimoussa5037 Жыл бұрын
Wow. Impressive experiment. Loved the video! You've earned a subscriber :)
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Ali!
@jamesdonnelly8888
@jamesdonnelly8888 Жыл бұрын
Your videos are a godsend, thank you so much. Absolutely brilliant work! I wish you were in my team
@AntonPutra
@AntonPutra Жыл бұрын
Thanks =)
@abderrahmanesmimite6137
@abderrahmanesmimite6137 Жыл бұрын
Thanks for the great work! As mentioned in other comments, Fiber, being based on fasthttp will be more interesting for the comparison and at the end of the day, perf and resource consumption are just factors that need to be crossed with speed of development and maintainability 😊
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Abderrahmane! I tested fiber, it's much faster..
@tshwarelolebeko4223
@tshwarelolebeko4223 Жыл бұрын
It would be better with fiber vs axum
@kamurashev
@kamurashev Жыл бұрын
Great content man! Appreciate it.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Kyrylo!
@richsadowsky8580
@richsadowsky8580 Жыл бұрын
Really great video Anton. Very quick but thorough explanation of how you built and ran this experiment. The findings are consistent with my expectations as another new student of Rust. I am using Rust on microcontrollers and it produces insanely efficient and safe code (as long as you stay away from much unsafe code). The learning code is steep but the payoffs are real and valuable.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Rich for the feedback. Agree the learning curve is much steeper but it's worth it!
@DimaLifeIsGood
@DimaLifeIsGood Жыл бұрын
Thank you for knowledge sharing, Anton
@AntonPutra
@AntonPutra Жыл бұрын
welcome =)
@whoisj
@whoisj Жыл бұрын
so few folks seem to care about efficient software these days. happy to see this comparison being done.
@AntonPutra
@AntonPutra Жыл бұрын
Yeah, but rust has a much steeper learning curve..
@fprotimaru1944
@fprotimaru1944 Жыл бұрын
wow, just awesome video, thank you
@AntonPutra
@AntonPutra Жыл бұрын
Thanks fprotimaru!
@bodguy1035
@bodguy1035 Жыл бұрын
Great comparison, btw can you benchmark same logic with nodejs and java spring? It will be very useful when I choose which lang is performant or not.
@DasGehtSoNicht
@DasGehtSoNicht Жыл бұрын
Go is much better than Node and Rust is much better than Go but its harder to learn
@AntonPutra
@AntonPutra Жыл бұрын
100%
@AntonPutra
@AntonPutra Жыл бұрын
For sure, just need to come up with interesting scenarios..
@ArunKumarSah
@ArunKumarSah Жыл бұрын
@@AntonPutra Hi Anton.. Beautiful demo.. May be the same example calculations could be used to benchmark spring and node as well.. as all the remaining setup will remain mostly unchanged.
@hamu_sando
@hamu_sando Жыл бұрын
Would be nice to see this with some different frameworks and endpoints that do binary serialisation/deserialisation, etc. Then maybe perf test it with Gatling or similar tools.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks, working on one with grpc (serialisation/deserialisation) & rest/json
@rc_campos
@rc_campos Жыл бұрын
Great content!
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Renato!
@emzx111
@emzx111 Жыл бұрын
so informative in 6 mins. great!!!!
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Emily!
@TweakMDS
@TweakMDS Жыл бұрын
Wow, I did not expect there to be this big of a difference. In my mind (purely based on reputation), golang was already pretty efficient, but this feels like comparing python with any other language, where rust comes out well and truly on top. Definitely worth exploring rust further. I'd be interested to see how a more involved use case including database access (pgsql or mongo) would pan out. My expectation is that the difference will be less, but it's still nice to explore the quality of database clients for example. Thanks for this.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Michael for the feedback. I'm working on the test that includes the postgres. By the way, somehow aws lambda written in go was faster, based on my previous benchmark...
@mmmhorsesteaks
@mmmhorsesteaks Жыл бұрын
Be careful with this conclusion - the implementations of Fibonacci are not the same so possibly the difference is smaller than you might expect based on these results.
@TweakMDS
@TweakMDS Жыл бұрын
@@mmmhorsesteaks Yeah, ideally you'd want an API to do a bunch of realistic stuff, like some file IO, some list sorting, a database call, and maybe even object transformations. In any case, this was a very solid test, and it matches some other results I found meanwhile.
@KrasilnikovIlya
@KrasilnikovIlya Жыл бұрын
Hi Anton! Thank you for the video, very interesting. Seems there is a small mistaking potentially making tests on the same node since the antiAffinity rules do not force running apps on different nodes. And you did not checked the apps are running on different nodes.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Ilya!
@codispatch6869
@codispatch6869 6 ай бұрын
Useful video, thanks for sharing 👍
@AntonPutra
@AntonPutra 5 ай бұрын
❤️
@0xDEAD_Inside
@0xDEAD_Inside Жыл бұрын
This is my final tipping point. I am now inclined to learn rust.
@AntonPutra
@AntonPutra Жыл бұрын
It's better to start now =)
@0xDEAD_Inside
@0xDEAD_Inside Жыл бұрын
@@AntonPutra yep
@rwmusic8126
@rwmusic8126 Жыл бұрын
Might get into Rust now that I just watched your video, thanks.
@AntonPutra
@AntonPutra Жыл бұрын
Not many production ready frameworks/docs…
@rwmusic8126
@rwmusic8126 Жыл бұрын
@@AntonPutra I know but still, very interesting. What about concurrency though? which one do you think is better?
@AntonPutra
@AntonPutra Жыл бұрын
@@rwmusic8126 It seems the tokio crate is mostly used for concurrency. I'm planning to test it as well sometime in the future..
@adityashelke5677
@adityashelke5677 5 ай бұрын
Resource consumption are just factors that need to be crossed with speed of development, maintainability and simplicity. If your peak priority is just performance irrespective of other factors then Rust is a good choice.
@AntonPutra
@AntonPutra 5 ай бұрын
💯
@shiva.sharan
@shiva.sharan Жыл бұрын
Awesome !
@AntonPutra
@AntonPutra Жыл бұрын
Thanks =)
@renatocunha6974
@renatocunha6974 Жыл бұрын
Fantastic test!!!!! Showwww!!!!! 👏👏👏👏👏💪👊👊👊
@AntonPutra
@AntonPutra Жыл бұрын
😅
@alexandredaubricourt5741
@alexandredaubricourt5741 Жыл бұрын
Would be nice to compare Nim with Rust. Knowing that Nim is much more concise and expressive then Go it would be a nice comparaison between two performant yet opposite languages
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Alexandre, I'll take a look!
@iiNoorbd
@iiNoorbd Жыл бұрын
Should compare Actix vs Fiber. Gin is not known for its performance
@VincentFree
@VincentFree Жыл бұрын
Indeed exactly what I was thinking
@MrAKAQUAN
@MrAKAQUAN Жыл бұрын
Fiber does not implement standard httpHandler of go. Besides, Fiber does not support http2.
@AntonPutra
@AntonPutra Жыл бұрын
I tested Fiber, it's much faster! I'll use it in my next benchmarks for sure!
@SirJagerYT
@SirJagerYT Жыл бұрын
@@AntonPutra Try Echo and Chi too
@juamsv
@juamsv Жыл бұрын
thanks for the video
@AntonPutra
@AntonPutra Жыл бұрын
Welcome!
@Dev-er2yq
@Dev-er2yq Жыл бұрын
I would suggest to use the same algorithm in both languages for calculating fibonacci number Go implementation ``` func FibonacciDP(n int) int { if n
@AntonPutra
@AntonPutra Жыл бұрын
Ok thanks!
@davidalvarez7965
@davidalvarez7965 Жыл бұрын
would you mind doing Go vs. Node / Python / PHP?
@AntonPutra
@AntonPutra Жыл бұрын
Sure
@brentsteyn6671
@brentsteyn6671 Жыл бұрын
Yes please 🙏
@ongkay250
@ongkay250 Жыл бұрын
up
@atabetuatara
@atabetuatara 9 ай бұрын
Hi Anton. Great videos. Really deep diving stuff! Very enjoyable & in many cases, very practical Re: latency: Rust has better latency? (~5m47s) diff is 0.01ms (4.53 vs 4.52 & 4.98 vs 4.97). Well within error function range of switching time between virtual cores/memory eviction & processing sequence of exposed Prometheus; I'd call that even. Like you said it's really not about Rust vs Go here but the underlying REST libraries. Having said that, Rust does have an edge, if it is slight in some cases (not all); But mass adoption of Rust vs "easier" languages (not vs Go) is not too dissimilar from learning Assembly vs C (BTW - worked with both; much older!); I'm not holding my breath.
@AntonPutra
@AntonPutra 9 ай бұрын
Thank you, Fadi, for the feedback! It's mostly framework comparisons, but some may find it helpful. I don't like purely algorithmic benchmarks; I find them not practical.
@habibicoding
@habibicoding Жыл бұрын
very interesting video!
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Habibi!
@seanknowles9985
@seanknowles9985 Жыл бұрын
Would be amazing to see Deno and Bun runtimes from the Javascript world added to this to see how they compare..
@AntonPutra
@AntonPutra Жыл бұрын
Thanks for the feedback, I'll definitely test them!
@chasim1982
@chasim1982 Жыл бұрын
Great Video 📹 as always ,as you mentioned nginx ingress controller provides all application level metrics, it means I should not implement any apm for my application example datadog apm?
@AntonPutra
@AntonPutra Жыл бұрын
Thanks, not all metrics, but you still should expose some application specific metrics
@chasim1982
@chasim1982 Жыл бұрын
@@AntonPutra Thanks for the reply, do you have any video, as per you mentioned "some application specific metrics" or can you can you please create? thanks
@jaysistar2711
@jaysistar2711 Жыл бұрын
How's the performance of Istio vs LinkerD vs NATS (for NATS, request response only) for multi-region?
@AntonPutra
@AntonPutra Жыл бұрын
Coming soon! multi regions is too expensive for me to run =)
@JimFeig
@JimFeig Жыл бұрын
It would be interesting to see if there is more memory bandwidth usage in Rust.
@AntonPutra
@AntonPutra Жыл бұрын
ok
@shinebayar
@shinebayar Жыл бұрын
Would've been awesome video if you included NodeJS & Python to see the entire picture if you're mentioning environment friendliness and cost savings.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Shinebayar, I'll definitely include node and python in the future videos! Another one is coming in a couple of days.
@shinebayar
@shinebayar Жыл бұрын
@@AntonPutra sounds good. Subbed for that.
@volodymyrliashenko1024
@volodymyrliashenko1024 Жыл бұрын
@@AntonPutra please include .net also.
@riendlyf
@riendlyf Жыл бұрын
Hello, great video. I’m going to deploy my app, can I use your configs? Should I remove something? I thought to use Baas, like appwrite, it is hard to me with the decision
@ongkay250
@ongkay250 Жыл бұрын
appwrite is my favorite
@AntonPutra
@AntonPutra Жыл бұрын
Of course you can use any of my code! It's under MIT =)
@adrustamm5828
@adrustamm5828 Жыл бұрын
Hello, thanks for the video, but do you validate the request response and response code? Rust might be quick but is the math correct?
@AntonPutra
@AntonPutra Жыл бұрын
I use k6 to run the test and validate the response code. k6.io/
@adrustamm5828
@adrustamm5828 Жыл бұрын
@@AntonPutra 100% OK Response on rust and go ? no timeouts ? no dropped packets ?
@angelbythewings
@angelbythewings Жыл бұрын
@@adrustamm5828 cpu usage was only 80 percent, for simple programs I wouldn't expect to see errors or timeouts at 80 percent. Also it was p99, so there is always some request that can escape
@adrustamm5828
@adrustamm5828 Жыл бұрын
@@angelbythewings I ve done a some stress tests with locust and I can tell you, errors and timeouts are there
@nandomax3
@nandomax3 Жыл бұрын
Being easy to learn is really important for the companies. I think that's a reason for the low adherence for rust over go( go is really easy to learn)
@AntonPutra
@AntonPutra Жыл бұрын
Agree, go is much more beginner friendly!
@TheAmazingXizde
@TheAmazingXizde Жыл бұрын
Other important info, we tested ALL our Go services on my Company, and we found that Go Works better with one entire CPU on the workloads config, i didnt see witch value was on your teste,but would be important
@AntonPutra
@AntonPutra Жыл бұрын
Got it, I'll keep it in mind for the next time.
@conradtaylor29
@conradtaylor29 Ай бұрын
In order to get things working locally, can one just simply apply the yaml to a local K8s cluster and load the Grafana dashboards?
@AntonPutra
@AntonPutra Ай бұрын
well, yes you can just make sure you have enough resource for each app - github.com/antonputra/tutorials/blob/main/lessons/138/go-app/deploy/deployment.yaml#L23-L29 as well as other components including prometheus, grafanam ingress etc
@bjelinski1
@bjelinski1 Жыл бұрын
"saving environment" is a huge point here, and we don't even compare to most common environment polluters - Java & C#. Yes, we have to migrate apps with big loads to Rust, to save the planet. ASAP! I did it personally, gain not without pain, but the results have been jaw dropping.
@AntonPutra
@AntonPutra Жыл бұрын
😅
@user-hd2vl8dy8i
@user-hd2vl8dy8i Жыл бұрын
когда с лёгкостью понимаешь каждое слово))
@AntonPutra
@AntonPutra Жыл бұрын
😅
@MisganaBayetta
@MisganaBayetta Жыл бұрын
Would be cool if you can optimize the CPU intensive codes for both based on comments and make a sequel.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Misgana, yes working it =)
@user-xs3rz1jj4i
@user-xs3rz1jj4i Жыл бұрын
How about using f-stack DPDK? I think this is the most most faster way. I want to see the test thank you ❤
@AntonPutra
@AntonPutra Жыл бұрын
Thanks, I'll take a look!
@night23412
@night23412 Жыл бұрын
how would express and fastapi/flask perform in these benchmarks?
@AntonPutra
@AntonPutra Жыл бұрын
Working on, but with fiber..
@agirornsimonarson
@agirornsimonarson 12 сағат бұрын
Could you also do this for rust vs C# ? I know it is silly but it would be a "nice to have" to convince some centerpiece folks ;)
@AntonPutra
@AntonPutra 5 сағат бұрын
well maybe in the future working on full courses tight now
@EzequielRegaldo
@EzequielRegaldo Жыл бұрын
Can you do same benchs with same fibbo in both lang and fiber instead gin ? :O looks good
@AntonPutra
@AntonPutra Жыл бұрын
I'll use fiber next
@wxSoftThePointOfU
@wxSoftThePointOfU Жыл бұрын
Ты использовал Gin, а как на счет Fiber?
@AntonPutra
@AntonPutra Жыл бұрын
I'll check it out
@Rogueixpresents
@Rogueixpresents Жыл бұрын
Can you do another test with Go but use Fiber instead of Gin? cuz gin is a full web framework and fiber it's just lighter form of Gin. The Go stats seemed a bit thicker imo cuz of the Gin web framework you know? Cheers
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Skoozle for the suggestion, I'll use Fiber for my next video
@halimabu1116
@halimabu1116 Жыл бұрын
As a backend developer, I want to learn a new programming language. Between Rust and Golang, which one do you recommend? Thanks
@AntonPutra
@AntonPutra Жыл бұрын
If you want to be employed now you should learn Go, there are not a lot of jobs in Rust yet
@thatonesnowboarde
@thatonesnowboarde Жыл бұрын
I would have really like to adopt rust for my web development, but the learning curve was a bit too time consuming for me, and I find that go was very intuitive coming from php. Now if they came out with a framework with great documentation, tutorials, and was focused on MVC style concepts I may reconsider. But considering shopee and other major companies are using golang I think its probably fast enough for even multi-billion / trillion dollar companies.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks for the feedback!
@sam-bu4hk
@sam-bu4hk Жыл бұрын
You Can try Graphul
@sam-bu4hk
@sam-bu4hk Жыл бұрын
@toast what APIs do you think are missing?
@rez188
@rez188 Жыл бұрын
Axum has fantastic documentation, and is becoming the go-to http framework for rust
@arcstur
@arcstur Жыл бұрын
Actix-web is great too!
@dmitriyobidin6049
@dmitriyobidin6049 Жыл бұрын
Considering the learning curve - go brings very good performance.
@AntonPutra
@AntonPutra Жыл бұрын
i was expecting you'll say rust =)
@dmitriyobidin6049
@dmitriyobidin6049 Жыл бұрын
@@AntonPutra I mean comparing learning curve of rust and go, go still performs well with a much easier learning curve. You can get decent result in go, investing 10x less time than rust. To get a decent performance in rust involves learning many more new terms and concepts than golang.
@AntonPutra
@AntonPutra Жыл бұрын
@@dmitriyobidin6049 agree with that
@swarnavasamanta2628
@swarnavasamanta2628 Жыл бұрын
The Fibonacci algorithm you used is based on recursion and everytime a recursive call is placed a new function is called in the function stack which means it also context switches the previous function and it takes a lot of time. Ideally you don't want to use recursion for simple tasks that can be done in a loop. Use recursion to solve problems meant for recursion. If you implement the same function through loop, i am willing to bet you that you'll lose most of the CPU execution time.
@AntonPutra
@AntonPutra Жыл бұрын
What would you recommend to simulate CPU load in different languages?
@swarnavasamanta2628
@swarnavasamanta2628 Жыл бұрын
@@AntonPutra You're trying to simulate server load, so basically you fetch a document from storage do some computation that modifies the document and then send it to the client(ideally what most web servers would do)
@AntonPutra
@AntonPutra Жыл бұрын
@@swarnavasamanta2628 thanks
@window.location
@window.location Жыл бұрын
You should have used native net package for building webserver in go instead of gin.
@AntonPutra
@AntonPutra Жыл бұрын
Yeah, but wanted to compare most popular frameworks..
@RudraSingh-pb5ls
@RudraSingh-pb5ls Жыл бұрын
@@AntonPutra can you also compare it with java springboot or other suitable java based backend framework ?
@angelbythewings
@angelbythewings Жыл бұрын
@@RudraSingh-pb5ls Java won't even clear the qualification round
@RudraSingh-pb5ls
@RudraSingh-pb5ls Жыл бұрын
@@angelbythewings why ? Just asking cause i have limited knowledge
@angelbythewings
@angelbythewings Жыл бұрын
@@RudraSingh-pb5ls Java is too resource intensive, I used to like java for how rich the development environment is, but as soon as you start to scale up, it starts adding to the cost considerably. It is very resource intensive. for comparison rust will take less than 10% of the resources that Java needs even for something as simple as a web server. both in terms of cpu cycles and memory. Now think of running micro services where you have 10-20 instances. you get the idea....
@kaplansedat
@kaplansedat Жыл бұрын
C# dotnet? Why texhscene ignores these in benchmarks?
@AntonPutra
@AntonPutra Жыл бұрын
Sure, sometime in the future!
@yonatanlinik562
@yonatanlinik562 Жыл бұрын
Why is the Rust logo so angry?
@AntonPutra
@AntonPutra Жыл бұрын
It's a revanche =)
@JoseHenrique-xg1lp
@JoseHenrique-xg1lp Жыл бұрын
Well... 15% difference may or not be a dealbreaker. Sometimes a better EC2 instance is cheaper than a Rust rewrite. It's counter-intuitive that Docker itself is written in Go whilst Redis is pure C.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks for feedback
@RibeiroLucasDev
@RibeiroLucasDev Жыл бұрын
Well, by the comments below we can agree that it would be nice a part two using the same algorithm (it could the fibonacci one) in native rust and go.
@AntonPutra
@AntonPutra Жыл бұрын
Sure =)
@doit4941
@doit4941 Жыл бұрын
what command is hey? is it app?or?
@AntonPutra
@AntonPutra Жыл бұрын
It’s a load generating tool, you can find it by googling hey GitHub, it’s written in go by the way. Happy new year! :)
@funnynews341
@funnynews341 Жыл бұрын
do more with c++ please, (go, rust and c++)
@AntonPutra
@AntonPutra Жыл бұрын
💯
@user-tl4sc9wz4r
@user-tl4sc9wz4r Жыл бұрын
Очень информативно
@AntonPutra
@AntonPutra Жыл бұрын
spasibo =)
@AnimexBoy7
@AnimexBoy7 Жыл бұрын
How does Scala compare to both Rust and Go?
@AntonPutra
@AntonPutra Жыл бұрын
share 2nd place
@AnimexBoy7
@AnimexBoy7 Жыл бұрын
@@AntonPutra Do you mean it would be slower and consume more CPU/Memory than both Go and Rust when attempting this REST API setup?
@AnimexBoy7
@AnimexBoy7 Жыл бұрын
I'm curious if Twitter should use Rust/Go instead of Scala for certain parts of their backend such API related ones
@AntonPutra
@AntonPutra Жыл бұрын
@@AnimexBoy7 To be honest I don't know. I only used scala when I had to write data pipelines with spark. Application is very different what typically rust and go used
@arcstur
@arcstur Жыл бұрын
I would love to see Actix performance instead of Rocket heheh
@AntonPutra
@AntonPutra Жыл бұрын
Noted =)
@Luix
@Luix Жыл бұрын
Spikes are not a problem, free memory is important. You don’t save money using rust, think about the time it takes to learn and to write programs in rust. Also Golang concurrency is one of the best out there.
@AntonPutra
@AntonPutra Жыл бұрын
Agree, I love golang but still learning rust =)
@jcbritobr
@jcbritobr Жыл бұрын
Thats a lot false. The learning curve is high but borrow Checker will release software more reliable and safe than Go.
@codeline9387
@codeline9387 Жыл бұрын
было бы интересно посмотреть crystal в аналогичном тесте
@AntonPutra
@AntonPutra Жыл бұрын
Spasibo za feedback!
@emurmotol
@emurmotol Жыл бұрын
Can we try fiber. Subscribed. Nice video
@AntonPutra
@AntonPutra Жыл бұрын
Sure, I'll use it next time
@echoptic775
@echoptic775 Жыл бұрын
Cool video, but fyi, rocket is not getting many updates and people dont use it much anymore, the rust web servers that have become the standard are axum and actix
@AntonPutra
@AntonPutra Жыл бұрын
Thanks echoptic! I'll try them next time..
@Pavel9400
@Pavel9400 8 ай бұрын
Только вот не показал сколько запросов в секунду могут они обработать, мб Go больше запросов обрабатывает параллельно
@AntonPutra
@AntonPutra 8 ай бұрын
i think i have it there
@devfriday
@devfriday 2 күн бұрын
Rocket is not born to fast. Must be compare with axum, actix or ntex to make sure your right 🎉
@AntonPutra
@AntonPutra 2 күн бұрын
Okay, thanks for the feedback. Maybe in the future...
@user-kw9cu
@user-kw9cu Жыл бұрын
Прикольно
@AntonPutra
@AntonPutra Жыл бұрын
spasibo =)
@aditiarahman435
@aditiarahman435 Жыл бұрын
could you benchmark some popular messaging system, like rabbitmq, kafka, nats streaming, nsq
@AntonPutra
@AntonPutra Жыл бұрын
Yes, i was thinking about to compare data pipelines using different languages as well as to compare spark streaming and flink. comming soon..
@chloeturner9653
@chloeturner9653 Жыл бұрын
I'm tittering on the edge of switching to Rust from Go
@AntonPutra
@AntonPutra Жыл бұрын
Go ecosystem is much more mature
@chloeturner9653
@chloeturner9653 Жыл бұрын
@@AntonPutra very true i'll probably remain with go for the back and maybe convert the code into rust at a later date
@distrologic2925
@distrologic2925 Жыл бұрын
rust is awesome but I would warn anyone about getting too complex in the code, because it can get very tricky there are a lot of deep mechanics going on in the language that you may or may not understand from the start, so you might end up with many reiterations on your code before it actually works well. Designing ahead is not as easy as it is in other languages where the compiler just lets you do "anything". The rust compiler is much more restrictive and usually there are only a few good ways to do what you want, and getting it right as a novice is even more unlikely than in other languages. So make sure you really understand the deeper concepts before relying on them in your designs.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks for the feedback, I'll keep learning!
@salman0ansari
@salman0ansari Жыл бұрын
why didnt you used fiber?
@AntonPutra
@AntonPutra Жыл бұрын
I did in another test, it's much faster =)
@ducbinhvu9567
@ducbinhvu9567 Жыл бұрын
it's not really a comparaison between go vs rust. When you use many things like framework, webserver with, it has always the impact of each others. But I appreciate your video as well
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Duc! You're right it's more for entertainment.
@ScoutSniperMC
@ScoutSniperMC Жыл бұрын
Important nuance is scheduling. Go is preemptive whereas Rust is cooperative.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks, I'll read about it!
@phildenfer
@phildenfer Жыл бұрын
Rust's Rocket is nice, but I think in terms of performance, actix-web is even better.
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Phil, I'll use Actix or Axum next time.
@iqbaltaufiq17
@iqbaltaufiq17 Жыл бұрын
as someone who is learning Go right now, I like seeing comparison like this would love to see rust vs go vs php vs python
@AntonPutra
@AntonPutra Жыл бұрын
Thanks for the feedback, I still love go! But more to come =)
@jonatthu
@jonatthu Жыл бұрын
Could you do the same with async-graph rust vs c# hotcholate graphql?
@AntonPutra
@AntonPutra Жыл бұрын
Yes, in the future
@jonatthu
@jonatthu Жыл бұрын
I can help! If you need me to create both backends, please let me know, you would need just to modify and test since I’m not sure how to do it!
@jonatthu
@jonatthu Жыл бұрын
Do you have twitter?
@jonatthu
@jonatthu Жыл бұрын
I just tweeted you!
@AntonPutra
@AntonPutra Жыл бұрын
@@jonatthu sure, I need rust backend that downloads s3 image and saves the last modified date in postgress. Twitter twitter.com/antonvputra
@TON-vz3pe
@TON-vz3pe Жыл бұрын
Wow. Bravo. Thanks for proving Rust is a better choice.
@AntonPutra
@AntonPutra Жыл бұрын
It is but it has a steep learning curve!
@TON-vz3pe
@TON-vz3pe Жыл бұрын
@@AntonPutra That's right. But I also learned Rust in 1 month exactly. If you we have to passion to learn something then anything can be easy. Just lots of practice is required. Rust compiler is by far my best compiler I have ever used or known.
@asdasdaa7063
@asdasdaa7063 9 ай бұрын
can you do rust vs C++ please?
@AntonPutra
@AntonPutra 9 ай бұрын
I kinda did it already, while testing Istio (envoy based on c++) vs linkerd (rust based proxy).
@mnlnl65091
@mnlnl65091 Жыл бұрын
CPU should be very similar. Go does way better than JVM on memory. Just can't compete with C++ or Rust.
@AntonPutra
@AntonPutra Жыл бұрын
In theory, yes, but in practice, you use a bunch of libraries and frameworks that affect the efficiency
@alanramirezherrera7485
@alanramirezherrera7485 Жыл бұрын
Rocket is not really recommended as it doesn't get a lot of maintenance (bus factor of 1), there are better HTTP web frameworks, for example, Actix or Axum (I prefer Axum due to its integration with Tokio)
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Alan, I'll use one of them for the next tutorial.
@baxiry.
@baxiry. Жыл бұрын
On pre-known entries llvm (rust) stores and returns the result, and does not recalculate it during runtime, The app already knows what is the fibonacci(40) result In real programs the entries are unpredictable, I don't know how Rust would perform in that case ?? fibonacci(url_param_number)
@AntonPutra
@AntonPutra Жыл бұрын
Got it, thanks for feedback!
@brucerosner3547
@brucerosner3547 Жыл бұрын
Doesn't everybody know that Rust is faster than GoLang?
@AntonPutra
@AntonPutra Жыл бұрын
Apparently AWS lambda doesn't =)
@alexanderp4532
@alexanderp4532 Жыл бұрын
If you wanted to compare go vs rust, and not rocket vs gin, you had to use the most performant frameworks. A good candidate for go is fiber, which is based on fasthttp, but adds some almost zero cost sugar. Which framework is fastest on rust I don't know
@AntonPutra
@AntonPutra Жыл бұрын
Thanks Alexander, I've been using fiber for the last couple of weeks. It's very fast indeed.
@geeksy2278
@geeksy2278 Жыл бұрын
For real world application I highly recommend reading about why discord switched from go to rust.
@ResidentBio
@ResidentBio Жыл бұрын
It's out of date already, iirc discord did not move to nower go version which had included performance fixes on the garbage collector.
@geeksy2278
@geeksy2278 Жыл бұрын
@@ResidentBio This is language design and cannot be out of date. Even with fixes. Go has a GC, Rust does not.
@ResidentBio
@ResidentBio Жыл бұрын
@@geeksy2278 They did not make a switch due to the existence of the GC. As far as I recall, they tried to tweak go's GC to their needs until they gave up and moved that service to RUST to not depends on a GC and regain some extra control they can afford. What's out of date from what I understand is the reason they did not find the performance fix they were looking for. The immediate next version of Go had a improvement that would have addressed their need. Or so was in paper according to one of Go's maintainer iirc.
@AntonPutra
@AntonPutra Жыл бұрын
I've read it, thanks.
@deepanshuplaygames
@deepanshuplaygames 10 ай бұрын
Where is request per second comparison
@AntonPutra
@AntonPutra 10 ай бұрын
It should be there
@whoisj
@whoisj Жыл бұрын
next, compare Go to Java and/or C#, then Python. in my experience, Go is massively over sold.
@AntonPutra
@AntonPutra Жыл бұрын
Agree, working on it!
@thebaku8140
@thebaku8140 Жыл бұрын
@@AntonPutra c# vs java vs go would be great
@dhavald4359
@dhavald4359 Ай бұрын
you didn't tune GOGC and memory limit for go.
@AntonPutra
@AntonPutra Ай бұрын
what's the best practise?
@Disorrder
@Disorrder Жыл бұрын
That strong Russian accent 😃 Thanks for benchmarking!
@AntonPutra
@AntonPutra Жыл бұрын
Welcome, happy new year! :)
@serene6182
@serene6182 Жыл бұрын
Instead of gin, try fiber.
@AntonPutra
@AntonPutra Жыл бұрын
I tried it in another video, it was equivalent to grpc calls so i had to redesign the test =)
@DasGehtSoNicht
@DasGehtSoNicht Жыл бұрын
You'll get a lot more performance and less usage by building Rust with optimized release flags
@AntonPutra
@AntonPutra Жыл бұрын
What would you suggest?
@DasGehtSoNicht
@DasGehtSoNicht Жыл бұрын
@@AntonPutra Basic release flags [profile.release] strip = true # Automatically strip symbols from the binary opt-level = "s" # Optimize for size lto = true # Enable link time optimization codegen-units = 1 # Maximize size reduction optimizations
@DasGehtSoNicht
@DasGehtSoNicht Жыл бұрын
@@AntonPutra ... and Actix-Web ist faster than Rocket. If you want a restapi in Rust, Actix-Web is what you need
@koalakakes
@koalakakes Жыл бұрын
we're comparing unlike things here. the code really isnt the same on each app. Also i wouldnt save money converting something to rust from go because it takes like 5x longer to write something in rust than it does in go and i probably dont need that additional performance unless im doing some really specific systems programming at scale or something.
@AntonPutra
@AntonPutra Жыл бұрын
sure
@lying6624
@lying6624 Жыл бұрын
I don't get why you choosed Gin for a Golang, because Gin performs very poorly. It would be better if you would test goFiber on the fastest fasthttp-raw engine.
@AntonPutra
@AntonPutra Жыл бұрын
Agree, I'll use fiber next.
@preegnees6664
@preegnees6664 Жыл бұрын
Классный видос
@AntonPutra
@AntonPutra Жыл бұрын
spasibo!
@the_flask
@the_flask Жыл бұрын
do rust vs zig
@AntonPutra
@AntonPutra Жыл бұрын
Sure =)
@jaedson-barbosa
@jaedson-barbosa Жыл бұрын
I don't think Zig is ready to be used in production yet.
@the_flask
@the_flask Жыл бұрын
@@jaedson-barbosa Umm idk but there is a javascript runtime named Bun out there which is built on top of Zig
@amaanq8649
@amaanq8649 Жыл бұрын
@@the_flask that still doesn't mean its ready to be in production..
@the_flask
@the_flask Жыл бұрын
@@amaanq8649 When i said that
Go (Golang) vs Node JS: Performance Benchmark
6:01
Anton Putra
Рет қаралды 39 М.
I spent six months rewriting everything in Rust
15:11
chris biscardi
Рет қаралды 406 М.
La revancha 😱
00:55
Juan De Dios Pantoja 2
Рет қаралды 66 МЛН
She ruined my dominos! 😭 Cool train tool helps me #gadget
00:40
Go Gizmo!
Рет қаралды 54 МЛН
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 3,3 МЛН
Was Porting To Rust A Mistake?
25:41
Theo - t3․gg
Рет қаралды 60 М.
Traefik vs. Nginx performance benchmark
12:38
Anton Putra
Рет қаралды 36 М.
I'm Coming Around To Go...
21:33
Theo - t3․gg
Рет қаралды 101 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 900 М.
Go vs Rust vs Bun vs Node | Prime Reacts
18:07
ThePrimeTime
Рет қаралды 160 М.
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 377 М.
why rust libraries may never exist.
7:26
Low Level Learning
Рет қаралды 223 М.
Go (Golang) vs. Rust performance benchmark
4:40
Anton Putra
Рет қаралды 14 М.
Go vs Rust: Which To Learn In 2024?
6:27
Kodaps Academy
Рет қаралды 138 М.
После ввода кода - протирайте панель
0:18
ТОП-5 культовых телефонов‼️
1:00
Pedant.ru
Рет қаралды 19 М.
Main filter..
0:15
CikoYt
Рет қаралды 7 МЛН
Cadiz smart lock official account unlocks the aesthetics of returning home
0:30
i like you subscriber ♥️♥️ #trending #iphone #apple #iphonefold
0:14