Go vs. Rust: Performance Benchmark

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ม.ค. 2025

ความคิดเห็น • 333

  • @AntonPutra
    @AntonPutra  ปีที่แล้ว +4

    👉 [Updated] Rust (actix) vs Go - th-cam.com/video/2hWfLiRGaNM/w-d-xo.html

  • @shifteleven
    @shifteleven 2 ปีที่แล้ว +224

    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  2 ปีที่แล้ว +10

      Thanks ShiftEleven for the feedback!

    • @oscarpinochet
      @oscarpinochet 2 ปีที่แล้ว +11

      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 2 ปีที่แล้ว +3

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

    • @BulbaWarrior
      @BulbaWarrior 2 ปีที่แล้ว +6

      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 2 ปีที่แล้ว +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 2 ปีที่แล้ว +252

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +32

      well except fibonacci

    • @shifteleven
      @shifteleven 2 ปีที่แล้ว +24

      @@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  2 ปีที่แล้ว +2

      @@shifteleven Thanks, I got your point

    • @ko-Daegu
      @ko-Daegu 2 ปีที่แล้ว +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 2 ปีที่แล้ว +65

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

  • @davidalvarez7965
    @davidalvarez7965 2 ปีที่แล้ว +11

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

  • @0xDEAD_Inside
    @0xDEAD_Inside 2 ปีที่แล้ว +11

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +2

      It's better to start now =)

    • @0xDEAD_Inside
      @0xDEAD_Inside 2 ปีที่แล้ว +2

      @@AntonPutra yep

  • @TweakMDS
    @TweakMDS 2 ปีที่แล้ว +16

    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  2 ปีที่แล้ว +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 2 ปีที่แล้ว +5

      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 2 ปีที่แล้ว

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

  • @nandomax3
    @nandomax3 2 ปีที่แล้ว +11

    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  2 ปีที่แล้ว +1

      Agree, go is much more beginner friendly!

  • @iiNoorbd
    @iiNoorbd 2 ปีที่แล้ว +30

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

    • @VincentFree
      @VincentFree 2 ปีที่แล้ว +1

      Indeed exactly what I was thinking

    • @MrAKAQUAN
      @MrAKAQUAN 2 ปีที่แล้ว

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +11

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

    • @SirJagerYT
      @SirJagerYT 2 ปีที่แล้ว

      @@AntonPutra Try Echo and Chi too

  • @sadiulhakim7814
    @sadiulhakim7814 4 หลายเดือนก่อน +1

    Would like to see Java Latest VS C# latest.

    • @AntonPutra
      @AntonPutra  4 หลายเดือนก่อน

      thanks noted!

  • @jamesdonnelly8888
    @jamesdonnelly8888 ปีที่แล้ว +2

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

  • @bodguy1035
    @bodguy1035 2 ปีที่แล้ว +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 2 ปีที่แล้ว +1

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      100%

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

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

    • @ArunKumarSah
      @ArunKumarSah 2 ปีที่แล้ว +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.

  • @kamurashev
    @kamurashev 2 ปีที่แล้ว +2

    Great content man! Appreciate it.

  • @nehjain
    @nehjain 4 หลายเดือนก่อน +2

    Can you do rust(actix) vs nodejs(express) so I can convince my team and manager to use rust over nodejs 😅

    • @AntonPutra
      @AntonPutra  4 หลายเดือนก่อน +1

      noted :)

  • @РэттБатлер
    @РэттБатлер 2 ปีที่แล้ว +5

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

  • @whoisj
    @whoisj 2 ปีที่แล้ว +5

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +4

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

  • @DimaLifeIsGood
    @DimaLifeIsGood 2 ปีที่แล้ว +1

    Thank you for knowledge sharing, Anton

  • @JimFeig
    @JimFeig ปีที่แล้ว +1

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

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

  • @kaplansedat
    @kaplansedat ปีที่แล้ว +1

    C# dotnet? Why texhscene ignores these in benchmarks?

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      Sure, sometime in the future!

  • @window.location
    @window.location 2 ปีที่แล้ว +5

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      Yeah, but wanted to compare most popular frameworks..

    • @RudraSingh-pb5ls
      @RudraSingh-pb5ls 2 ปีที่แล้ว

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

    • @angelbythewings
      @angelbythewings 2 ปีที่แล้ว +1

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

    • @RudraSingh-pb5ls
      @RudraSingh-pb5ls 2 ปีที่แล้ว

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

    • @angelbythewings
      @angelbythewings 2 ปีที่แล้ว +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....

  • @yonatanlinik562
    @yonatanlinik562 2 ปีที่แล้ว +5

    Why is the Rust logo so angry?

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      It's a revanche =)

  • @fprotimaru1944
    @fprotimaru1944 2 ปีที่แล้ว +1

    wow, just awesome video, thank you

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

      Thanks fprotimaru!

  • @abderrahmanesmimite6137
    @abderrahmanesmimite6137 2 ปีที่แล้ว +19

    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  2 ปีที่แล้ว +4

      Thanks Abderrahmane! I tested fiber, it's much faster..

    • @tshwarelolebeko4223
      @tshwarelolebeko4223 ปีที่แล้ว

      It would be better with fiber vs axum

  • @adityashelke5677
    @adityashelke5677 ปีที่แล้ว +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.

  • @shinebayar
    @shinebayar 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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 2 ปีที่แล้ว

      @@AntonPutra sounds good. Subbed for that.

    • @volodymyrliashenko1024
      @volodymyrliashenko1024 2 ปีที่แล้ว

      @@AntonPutra please include .net also.

  • @KrasilnikovIlya
    @KrasilnikovIlya 2 ปีที่แล้ว +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.

  • @doit4941
    @doit4941 2 ปีที่แล้ว +1

    what command is hey? is it app?or?

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +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! :)

  • @rwmusic8126
    @rwmusic8126 2 ปีที่แล้ว +3

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +2

      Not many production ready frameworks/docs…

    • @rwmusic8126
      @rwmusic8126 2 ปีที่แล้ว +1

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

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

  • @ainxgans
    @ainxgans 2 หลายเดือนก่อน

    from your name, do you have Indonesian descent?

  • @richsadowsky8580
    @richsadowsky8580 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

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

  • @agirornsimonarson
    @agirornsimonarson 6 หลายเดือนก่อน

    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  6 หลายเดือนก่อน

      well maybe in the future working on full courses tight now

  • @alimoussa5037
    @alimoussa5037 2 ปีที่แล้ว +5

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

  • @jaysistar2711
    @jaysistar2711 ปีที่แล้ว +1

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

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +1

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

  • @resurtm
    @resurtm หลายเดือนก่อน

    Late to the party, but nice content. Enjoyed it. Thanks! It seems like we'd pick Golang to get things done ASAP (much easier to learn/work with it), and Rust if we'd need top performance.

  • @alexandredaubricourt5741
    @alexandredaubricourt5741 2 ปีที่แล้ว +1

    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  2 ปีที่แล้ว +1

      Thanks Alexandre, I'll take a look!

  • @deepanshuplaygames
    @deepanshuplaygames ปีที่แล้ว

    Where is request per second comparison

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      It should be there

  • @呂奕珣
    @呂奕珣 2 ปีที่แล้ว +1

    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  2 ปีที่แล้ว +1

      Thanks, I'll take a look!

  • @hamu_sando
    @hamu_sando 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

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

  • @dmitriyobidin6049
    @dmitriyobidin6049 ปีที่แล้ว +1

    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

  • @thatonesnowboarde
    @thatonesnowboarde 2 ปีที่แล้ว +17

    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  2 ปีที่แล้ว

      Thanks for the feedback!

    • @sam-bu4hk
      @sam-bu4hk 2 ปีที่แล้ว

      You Can try Graphul

    • @sam-bu4hk
      @sam-bu4hk 2 ปีที่แล้ว

      @toast what APIs do you think are missing?

    • @rez188
      @rez188 2 ปีที่แล้ว

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

    • @arcstur
      @arcstur 2 ปีที่แล้ว

      Actix-web is great too!

  • @swarnavasamanta2628
    @swarnavasamanta2628 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

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

    • @swarnavasamanta2628
      @swarnavasamanta2628 2 ปีที่แล้ว

      @@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  2 ปีที่แล้ว

      @@swarnavasamanta2628 thanks

  • @emurmotol
    @emurmotol 2 ปีที่แล้ว +1

    Can we try fiber. Subscribed. Nice video

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

      Sure, I'll use it next time

  • @dhavald4359
    @dhavald4359 8 หลายเดือนก่อน

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

    • @AntonPutra
      @AntonPutra  8 หลายเดือนก่อน

      what's the best practise?

  • @TheAmazingXizde
    @TheAmazingXizde 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

  • @SAsquirtle
    @SAsquirtle 2 ปีที่แล้ว

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      Working on, but with fiber..

  • @sulaimantriarjo8097
    @sulaimantriarjo8097 3 หลายเดือนก่อน

    Where did you deploy them into? I learned the kubernetes in windows natively and in linux in virtual box but always failed when I restarted the PC

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      Oh, this is a very old test. Now, I deploy everything (for benchmarks) to AWS EKS using m7a.xlarge instances for applications and m7g.4xlarge instances for clients to generate load.
      th-cam.com/play/PLiMWaCMwGJXnKY6XmeifEpjIfkWRo9v2l.html

  • @rc_campos
    @rc_campos 2 ปีที่แล้ว +1

    Great content!

  • @bjelinski1
    @bjelinski1 2 ปีที่แล้ว

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

  • @salman0ansari
    @salman0ansari 2 ปีที่แล้ว

    why didnt you used fiber?

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

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

  • @adrustamm5828
    @adrustamm5828 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

    • @adrustamm5828
      @adrustamm5828 2 ปีที่แล้ว

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

    • @angelbythewings
      @angelbythewings 2 ปีที่แล้ว

      @@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 2 ปีที่แล้ว

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

  • @conradtaylor29
    @conradtaylor29 8 หลายเดือนก่อน

    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  8 หลายเดือนก่อน +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

  • @JoseHenrique-xg1lp
    @JoseHenrique-xg1lp 2 ปีที่แล้ว +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.

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      Thanks for feedback

  • @emzx111
    @emzx111 ปีที่แล้ว

    so informative in 6 mins. great!!!!

  • @aditiarahman435
    @aditiarahman435 2 ปีที่แล้ว +1

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

  • @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  ปีที่แล้ว +1

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

  • @seanknowles9985
    @seanknowles9985 2 ปีที่แล้ว +1

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

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

  • @codispatch6869
    @codispatch6869 ปีที่แล้ว +1

    Useful video, thanks for sharing 👍

  • @EzequielRegaldo
    @EzequielRegaldo 2 ปีที่แล้ว

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

      I'll use fiber next

  • @Pavel9400
    @Pavel9400 ปีที่แล้ว

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

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      i think i have it there

  • @wxSoftThePointOfU
    @wxSoftThePointOfU 2 ปีที่แล้ว

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      I'll check it out

  • @arcstur
    @arcstur 2 ปีที่แล้ว +3

    I would love to see Actix performance instead of Rocket heheh

  • @chasim1982
    @chasim1982 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

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

    • @chasim1982
      @chasim1982 2 ปีที่แล้ว

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

  • @juamsv
    @juamsv 2 ปีที่แล้ว +1

    thanks for the video

  • @atabetuatara
    @atabetuatara ปีที่แล้ว +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  ปีที่แล้ว

      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.

  • @shiva.sharan
    @shiva.sharan 2 ปีที่แล้ว +1

    Awesome !

  • @PhantasyAI0
    @PhantasyAI0 ปีที่แล้ว

    can you do rust vs C++ please?

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

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

  • @alimohammadizadeh2120
    @alimohammadizadeh2120 2 ปีที่แล้ว +1

    Please use actix instead of rocket

  • @renatocunha6974
    @renatocunha6974 2 ปีที่แล้ว

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

  • @riendlyf
    @riendlyf 2 ปีที่แล้ว

    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 2 ปีที่แล้ว

      appwrite is my favorite

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

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

  • @funnynews341
    @funnynews341 2 ปีที่แล้ว +2

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

  • @habibicoding
    @habibicoding 2 ปีที่แล้ว +1

    very interesting video!

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

      Thanks Habibi!

  • @Rogueixpresents
    @Rogueixpresents 2 ปีที่แล้ว

    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  2 ปีที่แล้ว

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

  • @baxiry.
    @baxiry. 2 ปีที่แล้ว +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)

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

      Got it, thanks for feedback!

  • @Бензини
    @Бензини 10 หลายเดือนก่อน

    But where rust at web development?

  • @Luix
    @Luix 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

      Agree, I love golang but still learning rust =)

    • @jcbritobr
      @jcbritobr 2 ปีที่แล้ว +2

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

  • @distrologic2925
    @distrologic2925 2 ปีที่แล้ว +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  2 ปีที่แล้ว

      Thanks for the feedback, I'll keep learning!

  • @Dev-er2yq
    @Dev-er2yq 2 ปีที่แล้ว +7

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

  • @codeline9387
    @codeline9387 2 ปีที่แล้ว +1

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      Spasibo za feedback!

  • @boyfriday36
    @boyfriday36 7 หลายเดือนก่อน

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

    • @AntonPutra
      @AntonPutra  7 หลายเดือนก่อน +1

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

  • @jonatthu
    @jonatthu 2 ปีที่แล้ว

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

      Yes, in the future

    • @jonatthu
      @jonatthu 2 ปีที่แล้ว +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 2 ปีที่แล้ว

      Do you have twitter?

    • @jonatthu
      @jonatthu 2 ปีที่แล้ว

      I just tweeted you!

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

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

  • @TamásOrbán-t3z
    @TamásOrbán-t3z 8 หลายเดือนก่อน

    why did u use framorkin golang ? ....no need it ... frameworks everywhere ....

    • @AntonPutra
      @AntonPutra  8 หลายเดือนก่อน

      it's a real-world example, not a scientific test

    • @TamásOrbán-t3z
      @TamásOrbán-t3z 8 หลายเดือนก่อน

      @@AntonPutra no need ....

    • @AntonPutra
      @AntonPutra  8 หลายเดือนก่อน

      @@TamásOrbán-t3z without framework you would need to implement auth, user management everything from scratch

    • @TamásOrbán-t3z
      @TamásOrbán-t3z 8 หลายเดือนก่อน

      @@AntonPutra yes at first time when u start programing :)))))) and go have packages :))))))

  • @ScoutSniperMC
    @ScoutSniperMC 2 ปีที่แล้ว

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      Thanks, I'll read about it!

  • @phildenfer
    @phildenfer 2 ปีที่แล้ว +1

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

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

  • @ducbinhvu9567
    @ducbinhvu9567 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

  • @iqbaltaufiq17
    @iqbaltaufiq17 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

  • @the_flask
    @the_flask 2 ปีที่แล้ว +6

    do rust vs zig

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +2

      Sure =)

    • @jaedson-barbosa
      @jaedson-barbosa 2 ปีที่แล้ว +5

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

    • @the_flask
      @the_flask 2 ปีที่แล้ว +2

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

    • @amaanq8649
      @amaanq8649 2 ปีที่แล้ว +1

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

    • @the_flask
      @the_flask 2 ปีที่แล้ว +2

      @@amaanq8649 When i said that

  • @Peace_upon_us2024
    @Peace_upon_us2024 2 ปีที่แล้ว +2

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

  • @RibeiroLucasDev
    @RibeiroLucasDev 2 ปีที่แล้ว

    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.

  • @TON-vz3pe
    @TON-vz3pe 2 ปีที่แล้ว +1

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      It is but it has a steep learning curve!

    • @TON-vz3pe
      @TON-vz3pe 2 ปีที่แล้ว

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

  • @echoptic775
    @echoptic775 2 ปีที่แล้ว

    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  2 ปีที่แล้ว

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

  • @geeksy2278
    @geeksy2278 2 ปีที่แล้ว

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

    • @ResidentBio
      @ResidentBio 2 ปีที่แล้ว

      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 2 ปีที่แล้ว

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

    • @ResidentBio
      @ResidentBio 2 ปีที่แล้ว

      @@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  2 ปีที่แล้ว

      I've read it, thanks.

  • @whoisj
    @whoisj 2 ปีที่แล้ว +2

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

      Agree, working on it!

    • @thebaku8140
      @thebaku8140 2 ปีที่แล้ว +1

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

  • @DasGehtSoNicht
    @DasGehtSoNicht 2 ปีที่แล้ว +1

    You'll get a lot more performance and less usage by building Rust with optimized release flags

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

      What would you suggest?

    • @DasGehtSoNicht
      @DasGehtSoNicht 2 ปีที่แล้ว

      @@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 2 ปีที่แล้ว

      @@AntonPutra ... and Actix-Web ist faster than Rocket. If you want a restapi in Rust, Actix-Web is what you need

  • @uday4717
    @uday4717 3 หลายเดือนก่อน +1

    In rust we trust

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      😊

  • @serene6182
    @serene6182 2 ปีที่แล้ว +1

    Instead of gin, try fiber.

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว +1

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

  • @lying6624
    @lying6624 2 ปีที่แล้ว +1

    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  2 ปีที่แล้ว

      Agree, I'll use fiber next.

  • @chloeturner9653
    @chloeturner9653 2 ปีที่แล้ว +1

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      Go ecosystem is much more mature

    • @chloeturner9653
      @chloeturner9653 2 ปีที่แล้ว

      @@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 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

  • @brucerosner3547
    @brucerosner3547 2 ปีที่แล้ว +2

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

    • @AntonPutra
      @AntonPutra  2 ปีที่แล้ว

      Apparently AWS lambda doesn't =)