Go is faster than Rust??! Go vs Rust vs TypeScript Servers (as a scientist)

preview_player
Показать описание
This represents the last couple months of twitches work building up and comparing the servers. I was completely shocked by the results of all this. HOW COULD GO DO ME LIKE THIS???

GET THE HELL IN THE START UP ALREADY
Discord for the degens
Twitch for the alpha chads

JS Sucks? Yes it does, it sucks so much that I made a hoodie (i only made 100 of them, so supply limited)

### The Project

### Support
If you wish to support, please consider sponsoring me on Github, or giving me that SWEET twitch sub!

They have been tagged so if you are curious at the testing commit, check it :)

### Editor

### Links

#vim #golang #rustlang
Рекомендации по теме
Комментарии
Автор

Rust has amazing performance when you get it right (which is hard). Go has good performance and you don’t even have to try that hard for it

angeliliev
Автор

The Rust code has a shared HashMap behind a mutex. That's most of the problem... You're completely removing any benefit of multithreading, because your other threads can't do any work when the HashMap is in use (which is all the time). You could try changing it for an RwLock, because most of the time, you seem to be only reading from it. Another option is to use a concurrent hashmap, like DashMap, which tries to be an easy replacement for RwLock<HashMap>.

Other (less important) issues are: You're heap-allocating all of your futures from Listenable because of async_trait, and you're spawning two tasks instead of one per connection, increasing pressure on the task scheduler.

__jan
Автор

When a comedian chooses a path in programming and becomes blazingly good at it you get ThePrimeagen.

renujadecosta
Автор

I'm more impressed with the tests you plan and write to make these comparisons than the actual results. I am baffled by the amount of time and work you just put into stuff like these. And the best part is, you do this because you're just crazy and love shit like this.
Love your videos man, inspiring .❤️.

mhmmdshaz
Автор

Hm, I'm actually not immensely surprised about the comparison between Rust and Go in the end with Go being actually fast with immensely lesser effort compared to Rust. There is a good chance that a highly optimised Rust version would perform even better, but at some point you gotta ask yourself how fast do you actually need it to be and is it worth it.

Thank you for the video, prime!

Hedshodd
Автор

So fun to watch and still very informative. Keep going!

gustavoluchi
Автор

Would love to see if any highly experienced go/rust people would take the challenge to reimplement or refactor what you wrote while you do a video measuring the time, discussing what optimizations were made, and which language truly blazes and which one got caught up asking for feet pics on the internet.

RobertBMenke
Автор

In my previous job i got a little exposure to Go and i really liked. This kind of informative videos solidify my decision to get better at Go and have the right tool for the right job (because getting to work in Kotlin backend outside of android apps is going to be really hard)

fedeanastasis
Автор

I found your channel originally because of VIM but have to say that all your videos are both educational and fun to watch. Keep it up!

yachint
Автор

Really appreciate the work you into this video! Thank you once again for making my day that much more BLAZINGLY FAST.

m.minkov
Автор

Slick content my guy. Love it. I'm glad someone has (mostly) unbiasedly confirmed what I've seen in many years of engineering software. Go is just faster and easier to write a blazingly fast solution to a problem in. There's very few foot guns, very few things to learn, and it compiles and runs your tests BLAZINGLY fast. IMHO if a language can get you even 80% of the way to the _fastest_ solution in ~20% of the time, then that should probably be your daily driver for latency sensitive applications.

Aaku
Автор

I would like to see more of this type of content please, thank you very much

andrei.terentev
Автор

This is actually the best case made I've heard for Go. Simpler to write, reasonable performance. I would go for it for my next project (even though I've already chosen rust for said project).

J-Kimble
Автор

I would love to see Elixir added to the mix, specifically for concurrent connections

sebastianhenao
Автор

This was great, honestly I just like to watch programming stuff in general. It is all very interesting, the whole space is so cool. Appreciate it!

lmnts
Автор

I am so glad I found this channel!! This is truly prime CONTENT right here, as well as it being helpful and educational is a nice benefit! TY TY for putting in the time and effort!

stormosone
Автор

Great work! Loving the humour and the Go vs Rust vs TypeScript comparison. Please give us more of this. We need moar..

PaulBurlumi
Автор

Prime, you're the best! This type of content is really gold, as per usual. Thank you for doing this videos and being informative while also being completely mad (as a scientist)!!!

Автор

I've waited for this video to come out blazing fast from its announcement! Strapping my seatbelts on 😁

earthling_parth
Автор

Typescript, you are fired
Go you are balanced blessed
Rust, you are currently giving your best, high hopes for you

love this kind of content

machinima