Go vs. Rust: Performance Benchmark

Sdílet
Vložit
  • čas přidán 12. 12. 2022
  • 🔴 - 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
  • Věda a technologie

Komentáře • 323

  • @AntonPutra
    @AntonPutra  Před 10 měsíci +2

    🔴 - To support my channel, I’d like to offer Mentorship/On-the-Job Support/Consulting - me@antonputra.com

  • @shifteleven
    @shifteleven Před rokem +201

    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  Před rokem +8

      Thanks ShiftEleven for the feedback!

    • @oscarpinochet
      @oscarpinochet Před rokem +7

      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 Před rokem +2

      I knew there was something like that haha Thanks! Now I don't need to check the code 🤣

    • @BulbaWarrior
      @BulbaWarrior Před rokem +5

      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 Před rokem +4

      @@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.

  • @andizumko8860
    @andizumko8860 Před rokem +236

    as you've rightly noted - it's more about comparing gin vs rocket, than rust vs go, but still, thanks, quite insightful

    • @AntonPutra
      @AntonPutra  Před rokem +30

      well except fibonacci

    • @shifteleven
      @shifteleven Před rokem +21

      @@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  Před rokem +1

      @@shifteleven Thanks, I got your point

    • @ko-Daegu
      @ko-Daegu Před rokem +6

      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

  • @Kumar-co1bp
    @Kumar-co1bp Před rokem +60

    I appreciate your effort in making and publishing this video. I appreciate the way you compared.

  • @jamesdonnelly8888
    @jamesdonnelly8888 Před rokem +1

    Your videos are a godsend, thank you so much. Absolutely brilliant work! I wish you were in my team

  • @alimoussa5037
    @alimoussa5037 Před rokem +3

    Wow. Impressive experiment. Loved the video! You've earned a subscriber :)

  • @kamurashev
    @kamurashev Před rokem +2

    Great content man! Appreciate it.

  • @AntonPutra
    @AntonPutra  Před rokem +1

    ❤Go (Golang) vs Java: czcams.com/video/8CiErLxdaA8/video.html
    ❤Go (Golang) vs Node JS - czcams.com/video/ntMKNlESCpM/video.html
    ❤AWS Lambda Go vs. Node.js - czcams.com/video/kJ4gfoe7gPQ/video.html
    ❤AWS Lambda Python vs. Node.js - czcams.com/video/B_OOim6XrI4/video.html

  • @abderrahmanesmimite6137
    @abderrahmanesmimite6137 Před rokem +18

    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 😊

  • @DimaLifeIsGood
    @DimaLifeIsGood Před rokem +1

    Thank you for knowledge sharing, Anton

  • @fprotimaru1944
    @fprotimaru1944 Před rokem +1

    wow, just awesome video, thank you

  • @rc_campos
    @rc_campos Před rokem +1

    Great content!

  • @richsadowsky8580
    @richsadowsky8580 Před rokem +7

    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  Před rokem +1

      Thanks Rich for the feedback. Agree the learning curve is much steeper but it's worth it!

  • @hamu_sando
    @hamu_sando Před rokem +2

    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  Před rokem +1

      Thanks, working on one with grpc (serialisation/deserialisation) & rest/json

  • @AntonPutra
    @AntonPutra  Před rokem +3

    ❤Performance Benchmarks Playlist - czcams.com/play/PLiMWaCMwGJXl-h2RgOSpdO-pQaSRwlVjd.html

  • @emzx111
    @emzx111 Před rokem

    so informative in 6 mins. great!!!!

  • @whoisj
    @whoisj Před rokem +2

    so few folks seem to care about efficient software these days. happy to see this comparison being done.

    • @AntonPutra
      @AntonPutra  Před rokem +2

      Yeah, but rust has a much steeper learning curve..

  • @KrasilnikovIlya
    @KrasilnikovIlya Před rokem +4

    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.

  • @juamsv
    @juamsv Před rokem +1

    thanks for the video

  • @shiva.sharan
    @shiva.sharan Před rokem +1

    Awesome !

  • @renatocunha6974
    @renatocunha6974 Před rokem

    Fantastic test!!!!! Showwww!!!!! 👏👏👏👏👏💪👊👊👊

  • @bodguy1035
    @bodguy1035 Před rokem +9

    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 Před rokem +1

      Go is much better than Node and Rust is much better than Go but its harder to learn

    • @AntonPutra
      @AntonPutra  Před rokem

      100%

    • @AntonPutra
      @AntonPutra  Před rokem

      For sure, just need to come up with interesting scenarios..

    • @ArunKumarSah
      @ArunKumarSah Před rokem +1

      @@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.

  • @habibicoding
    @habibicoding Před rokem +1

    very interesting video!

  • @codispatch6869
    @codispatch6869 Před 7 měsíci +1

    Useful video, thanks for sharing 👍

  • @adityashelke5677
    @adityashelke5677 Před 7 měsíci +2

    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.

  • @JimFeig
    @JimFeig Před rokem +1

    It would be interesting to see if there is more memory bandwidth usage in Rust.

  • @TweakMDS
    @TweakMDS Před rokem +15

    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  Před rokem +1

      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 Před rokem +4

      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 Před rokem

      @@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.

  • @davidalvarez7965
    @davidalvarez7965 Před rokem +10

    would you mind doing Go vs. Node / Python / PHP?

  • @seanknowles9985
    @seanknowles9985 Před rokem +1

    Would be amazing to see Deno and Bun runtimes from the Javascript world added to this to see how they compare..

    • @AntonPutra
      @AntonPutra  Před rokem

      Thanks for the feedback, I'll definitely test them!

  • @rwmusic8126
    @rwmusic8126 Před rokem +3

    Might get into Rust now that I just watched your video, thanks.

    • @AntonPutra
      @AntonPutra  Před rokem +2

      Not many production ready frameworks/docs…

    • @rwmusic8126
      @rwmusic8126 Před rokem +1

      @@AntonPutra I know but still, very interesting. What about concurrency though? which one do you think is better?

    • @AntonPutra
      @AntonPutra  Před rokem +1

      @@rwmusic8126 It seems the tokio crate is mostly used for concurrency. I'm planning to test it as well sometime in the future..

  • @shinebayar
    @shinebayar Před rokem +5

    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  Před rokem +6

      Thanks Shinebayar, I'll definitely include node and python in the future videos! Another one is coming in a couple of days.

    • @shinebayar
      @shinebayar Před rokem

      @@AntonPutra sounds good. Subbed for that.

    • @volodymyrliashenko1024
      @volodymyrliashenko1024 Před rokem

      @@AntonPutra please include .net also.

  • @EzequielRegaldo
    @EzequielRegaldo Před rokem

    Can you do same benchs with same fibbo in both lang and fiber instead gin ? :O looks good

  • @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  Před rokem +1

      Thanks Alexandre, I'll take a look!

  • @chasim1982
    @chasim1982 Před rokem +1

    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  Před rokem +1

      Thanks, not all metrics, but you still should expose some application specific metrics

    • @chasim1982
      @chasim1982 Před rokem

      @@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

  • @MisganaBayetta
    @MisganaBayetta Před rokem +4

    Would be cool if you can optimize the CPU intensive codes for both based on comments and make a sequel.

    • @AntonPutra
      @AntonPutra  Před rokem +2

      Thanks Misgana, yes working it =)

  • @atabetuatara
    @atabetuatara Před 11 měsíci +1

    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  Před 10 měsíci

      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.

  • @0xDEAD_Inside
    @0xDEAD_Inside Před rokem +5

    This is my final tipping point. I am now inclined to learn rust.

  • @user-xs3rz1jj4i
    @user-xs3rz1jj4i Před rokem +1

    How about using f-stack DPDK? I think this is the most most faster way. I want to see the test thank you ❤

  • @agirornsimonarson
    @agirornsimonarson Před měsícem

    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  Před měsícem

      well maybe in the future working on full courses tight now

  • @Dev-er2yq
    @Dev-er2yq Před rokem +3

    I would suggest to use the same algorithm in both languages for calculating fibonacci number
    Go implementation
    ```
    func FibonacciDP(n int) int {
    if n

  • @night23412
    @night23412 Před rokem

    how would express and fastapi/flask perform in these benchmarks?

  • @jaysistar2711
    @jaysistar2711 Před rokem +1

    How's the performance of Istio vs LinkerD vs NATS (for NATS, request response only) for multi-region?

    • @AntonPutra
      @AntonPutra  Před rokem +1

      Coming soon! multi regions is too expensive for me to run =)

  • @TheAmazingXizde
    @TheAmazingXizde Před rokem +1

    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  Před rokem

      Got it, I'll keep it in mind for the next time.

  • @user-hd2vl8dy8i
    @user-hd2vl8dy8i Před rokem +2

    когда с лёгкостью понимаешь каждое слово))

  • @riendlyf
    @riendlyf Před rokem

    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 Před rokem

      appwrite is my favorite

    • @AntonPutra
      @AntonPutra  Před rokem

      Of course you can use any of my code! It's under MIT =)

  • @Rogueixpresents
    @Rogueixpresents Před rokem

    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  Před rokem

      Thanks Skoozle for the suggestion, I'll use Fiber for my next video

  • @adrustamm5828
    @adrustamm5828 Před rokem +1

    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  Před rokem

      I use k6 to run the test and validate the response code.
      k6.io/

    • @adrustamm5828
      @adrustamm5828 Před rokem

      @@AntonPutra 100% OK Response on rust and go ? no timeouts ? no dropped packets ?

    • @angelbythewings
      @angelbythewings Před rokem

      @@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 Před rokem

      @@angelbythewings I ve done a some stress tests with locust and I can tell you, errors and timeouts are there

  • @nandomax3
    @nandomax3 Před rokem +9

    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  Před rokem

      Agree, go is much more beginner friendly!

  • @window.location
    @window.location Před rokem +5

    You should have used native net package for building webserver in go instead of gin.

    • @AntonPutra
      @AntonPutra  Před rokem

      Yeah, but wanted to compare most popular frameworks..

    • @RudraSingh-pb5ls
      @RudraSingh-pb5ls Před rokem

      @@AntonPutra can you also compare it with java springboot or other suitable java based backend framework ?

    • @angelbythewings
      @angelbythewings Před rokem +1

      @@RudraSingh-pb5ls Java won't even clear the qualification round

    • @RudraSingh-pb5ls
      @RudraSingh-pb5ls Před rokem

      @@angelbythewings why ? Just asking cause i have limited knowledge

    • @angelbythewings
      @angelbythewings Před rokem +1

      @@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....

  • @funnynews341
    @funnynews341 Před rokem +2

    do more with c++ please, (go, rust and c++)

  • @emurmotol
    @emurmotol Před rokem +1

    Can we try fiber. Subscribed. Nice video

  • @bjelinski1
    @bjelinski1 Před rokem

    "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.

  • @iiNoorbd
    @iiNoorbd Před rokem +27

    Should compare Actix vs Fiber. Gin is not known for its performance

    • @VincentFree
      @VincentFree Před rokem +1

      Indeed exactly what I was thinking

    • @MrAKAQUAN
      @MrAKAQUAN Před rokem

      Fiber does not implement standard httpHandler of go. Besides, Fiber does not support http2.

    • @AntonPutra
      @AntonPutra  Před rokem +5

      I tested Fiber, it's much faster! I'll use it in my next benchmarks for sure!

    • @SirJagerYT
      @SirJagerYT Před rokem

      @@AntonPutra Try Echo and Chi too

  • @swarnavasamanta2628
    @swarnavasamanta2628 Před rokem +1

    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  Před rokem +1

      What would you recommend to simulate CPU load in different languages?

    • @swarnavasamanta2628
      @swarnavasamanta2628 Před rokem

      @@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  Před rokem

      @@swarnavasamanta2628 thanks

  • @conradtaylor29
    @conradtaylor29 Před 3 měsíci

    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  Před 3 měsíci +1

      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

  • @Peace_upon_us2024
    @Peace_upon_us2024 Před rokem +2

    Очень информативно

  • @wxSoftThePointOfU
    @wxSoftThePointOfU Před rokem

    Ты использовал Gin, а как на счет Fiber?

  • @codeline9387
    @codeline9387 Před rokem +1

    было бы интересно посмотреть crystal в аналогичном тесте

  • @kaplansedat
    @kaplansedat Před rokem +1

    C# dotnet? Why texhscene ignores these in benchmarks?

  • @yonatanlinik562
    @yonatanlinik562 Před rokem +5

    Why is the Rust logo so angry?

  • @arcstur
    @arcstur Před rokem +3

    I would love to see Actix performance instead of Rocket heheh

  • @AnimexBoy7
    @AnimexBoy7 Před rokem

    How does Scala compare to both Rust and Go?

    • @AntonPutra
      @AntonPutra  Před rokem

      share 2nd place

    • @AnimexBoy7
      @AnimexBoy7 Před rokem

      @@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 Před rokem

      I'm curious if Twitter should use Rust/Go instead of Scala for certain parts of their backend such API related ones

    • @AntonPutra
      @AntonPutra  Před rokem

      @@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

  • @JoseHenrique-xg1lp
    @JoseHenrique-xg1lp Před rokem +1

    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.

  • @asdasdaa7063
    @asdasdaa7063 Před 11 měsíci

    can you do rust vs C++ please?

    • @AntonPutra
      @AntonPutra  Před 10 měsíci

      I kinda did it already, while testing Istio (envoy based on c++) vs linkerd (rust based proxy).

  • @doit4941
    @doit4941 Před rokem +1

    what command is hey? is it app?or?

    • @AntonPutra
      @AntonPutra  Před rokem +1

      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! :)

  • @salman0ansari
    @salman0ansari Před rokem

    why didnt you used fiber?

    • @AntonPutra
      @AntonPutra  Před rokem

      I did in another test, it's much faster =)

  • @RibeiroLucasDev
    @RibeiroLucasDev Před rokem

    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.

  • @echoptic775
    @echoptic775 Před rokem

    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  Před rokem

      Thanks echoptic! I'll try them next time..

  • @halimabu1116
    @halimabu1116 Před rokem

    As a backend developer, I want to learn a new programming language. Between Rust and Golang, which one do you recommend?
    Thanks

    • @AntonPutra
      @AntonPutra  Před rokem +1

      If you want to be employed now you should learn Go, there are not a lot of jobs in Rust yet

  • @thatonesnowboarde
    @thatonesnowboarde Před rokem +16

    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  Před rokem

      Thanks for the feedback!

    • @sam-bu4hk
      @sam-bu4hk Před rokem

      You Can try Graphul

    • @sam-bu4hk
      @sam-bu4hk Před rokem

      @toast what APIs do you think are missing?

    • @rez188
      @rez188 Před rokem

      Axum has fantastic documentation, and is becoming the go-to http framework for rust

    • @arcstur
      @arcstur Před rokem

      Actix-web is great too!

  • @dmitriyobidin6049
    @dmitriyobidin6049 Před rokem +1

    Considering the learning curve - go brings very good performance.

    • @AntonPutra
      @AntonPutra  Před rokem

      i was expecting you'll say rust =)

    • @dmitriyobidin6049
      @dmitriyobidin6049 Před rokem

      @@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  Před rokem

      @@dmitriyobidin6049 agree with that

  • @devfriday
    @devfriday Před měsícem

    Rocket is not born to fast. Must be compare with axum, actix or ntex to make sure your right 🎉

    • @AntonPutra
      @AntonPutra  Před měsícem +1

      Okay, thanks for the feedback. Maybe in the future...

  • @jonatthu
    @jonatthu Před rokem

    Could you do the same with async-graph rust vs c# hotcholate graphql?

    • @AntonPutra
      @AntonPutra  Před rokem +1

      Yes, in the future

    • @jonatthu
      @jonatthu Před rokem +1

      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 Před rokem

      Do you have twitter?

    • @jonatthu
      @jonatthu Před rokem

      I just tweeted you!

    • @AntonPutra
      @AntonPutra  Před rokem +1

      @@jonatthu sure, I need rust backend that downloads s3 image and saves the last modified date in postgress. Twitter twitter.com/antonvputra

  • @Pavel9400
    @Pavel9400 Před 9 měsíci

    Только вот не показал сколько запросов в секунду могут они обработать, мб Go больше запросов обрабатывает параллельно

  • @aditiarahman435
    @aditiarahman435 Před rokem +1

    could you benchmark some popular messaging system, like rabbitmq, kafka, nats streaming, nsq

    • @AntonPutra
      @AntonPutra  Před rokem

      Yes, i was thinking about to compare data pipelines using different languages as well as to compare spark streaming and flink. comming soon..

  • @deepanshuplaygames
    @deepanshuplaygames Před 11 měsíci

    Where is request per second comparison

  • @user-kw9cu
    @user-kw9cu Před rokem +1

    Прикольно

  • @distrologic2925
    @distrologic2925 Před rokem +1

    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  Před rokem

      Thanks for the feedback, I'll keep learning!

  • @baxiry.
    @baxiry. Před rokem +3

    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)

  • @ducbinhvu9567
    @ducbinhvu9567 Před rokem +1

    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  Před rokem

      Thanks Duc! You're right it's more for entertainment.

  • @dhavald4359
    @dhavald4359 Před 3 měsíci

    you didn't tune GOGC and memory limit for go.

  • @alexanderp4532
    @alexanderp4532 Před rokem

    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  Před rokem

      Thanks Alexander, I've been using fiber for the last couple of weeks. It's very fast indeed.

  • @iqbaltaufiq17
    @iqbaltaufiq17 Před rokem +1

    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  Před rokem

      Thanks for the feedback, I still love go! But more to come =)

  • @phildenfer
    @phildenfer Před rokem +1

    Rust's Rocket is nice, but I think in terms of performance, actix-web is even better.

    • @AntonPutra
      @AntonPutra  Před rokem

      Thanks Phil, I'll use Actix or Axum next time.

  • @geeksy2278
    @geeksy2278 Před rokem

    For real world application I highly recommend reading about why discord switched from go to rust.

    • @ResidentBio
      @ResidentBio Před rokem

      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 Před rokem

      @@ResidentBio This is language design and cannot be out of date. Even with fixes. Go has a GC, Rust does not.

    • @ResidentBio
      @ResidentBio Před rokem

      @@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  Před rokem

      I've read it, thanks.

  • @ScoutSniperMC
    @ScoutSniperMC Před rokem

    Important nuance is scheduling. Go is preemptive whereas Rust is cooperative.

  • @chloeturner9653
    @chloeturner9653 Před rokem +1

    I'm tittering on the edge of switching to Rust from Go

    • @AntonPutra
      @AntonPutra  Před rokem

      Go ecosystem is much more mature

    • @chloeturner9653
      @chloeturner9653 Před rokem

      @@AntonPutra very true i'll probably remain with go for the back and maybe convert the code into rust at a later date

  • @alanramirezherrera7485
    @alanramirezherrera7485 Před rokem +1

    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  Před rokem

      Thanks Alan, I'll use one of them for the next tutorial.

  • @Disorrder
    @Disorrder Před rokem +1

    That strong Russian accent 😃
    Thanks for benchmarking!

  • @TON-vz3pe
    @TON-vz3pe Před rokem +1

    Wow. Bravo. Thanks for proving Rust is a better choice.

    • @AntonPutra
      @AntonPutra  Před rokem

      It is but it has a steep learning curve!

    • @TON-vz3pe
      @TON-vz3pe Před rokem

      @@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.

  • @alimohammadizadeh2120
    @alimohammadizadeh2120 Před rokem +1

    Please use actix instead of rocket

  • @Luix
    @Luix Před rokem +4

    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  Před rokem +1

      Agree, I love golang but still learning rust =)

    • @jcbritobr
      @jcbritobr Před rokem +2

      Thats a lot false. The learning curve is high but borrow Checker will release software more reliable and safe than Go.

  • @preegnees6664
    @preegnees6664 Před rokem +1

    Классный видос

  • @brucerosner3547
    @brucerosner3547 Před rokem +2

    Doesn't everybody know that Rust is faster than GoLang?

  • @mnlnl65091
    @mnlnl65091 Před rokem +1

    CPU should be very similar. Go does way better than JVM on memory. Just can't compete with C++ or Rust.

    • @AntonPutra
      @AntonPutra  Před rokem +1

      In theory, yes, but in practice, you use a bunch of libraries and frameworks that affect the efficiency

  • @koalakakes
    @koalakakes Před rokem

    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.

  • @the_flask
    @the_flask Před rokem +6

    do rust vs zig

    • @AntonPutra
      @AntonPutra  Před rokem +2

      Sure =)

    • @jaedson-barbosa
      @jaedson-barbosa Před rokem +5

      I don't think Zig is ready to be used in production yet.

    • @the_flask
      @the_flask Před rokem +2

      @@jaedson-barbosa Umm idk but there is a javascript runtime named Bun out there which is built on top of Zig

    • @amaanq8649
      @amaanq8649 Před rokem +1

      @@the_flask that still doesn't mean its ready to be in production..

    • @the_flask
      @the_flask Před rokem +2

      @@amaanq8649 When i said that

  • @whoisj
    @whoisj Před rokem +2

    next, compare Go to Java and/or C#, then Python. in my experience, Go is massively over sold.

    • @AntonPutra
      @AntonPutra  Před rokem +1

      Agree, working on it!

    • @thebaku8140
      @thebaku8140 Před rokem +1

      @@AntonPutra c# vs java vs go would be great

  • @serene6182
    @serene6182 Před rokem +1

    Instead of gin, try fiber.

    • @AntonPutra
      @AntonPutra  Před rokem +1

      I tried it in another video, it was equivalent to grpc calls so i had to redesign the test =)

  • @user-hz3tr9bu1h
    @user-hz3tr9bu1h Před 5 měsíci

    But where rust at web development?