Rust vs. Go (Golang): Performance (Only Standard Library)

preview_player
Показать описание

▬▬▬▬▬ Experience & Location 💼 ▬▬▬▬▬
► I’m a Senior Software Engineer at Juniper Networks (13+ years of experience)
► Located in San Francisco Bay Area, CA (US citizen)

▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬

▬▬▬▬▬▬▬ Source Code 📚 ▬▬▬▬▬▬▬

#deno #bun #nodejs
Рекомендации по теме
Комментарии
Автор

Mistery solved: the toy server in rust performs bad because it lacks support for keep alive. After turning off keep alive in go I get the very dame bad performance. Also, I get the same requests per second (60k) for the rust and go apps after implementing very rudimentary support for it

oh_no_naming_is_hard
Автор

This is testing standard libraries as they both described in their documentations. That's a fair test IMHO

AmenAmenzo
Автор

Rust benchmark without Tokio is like testing a Ferrari in 1st gear

tomhoma
Автор

For the kind of work I do, Rust takes longer to write and runs slower than Go. Workflows involving RPC, I/O, and networking favor Go, making it much easier to be productive. Rust shines at systems programming, CPU bound tasks, and hardware interfacing, which I rarely do. Right tool for the right job.

rednafi
Автор

Welp. Here is the difference between first straight forward naive approach vs industry standard tool with a decade of improvements. Bubble sort vs QuickSort. It's not the language.

PaulBunkey
Автор

Thank you Anton for making these insightful comparison videos! They are very helpful and educational.

However, I would like to point out that this particular benchmark may not be entirely fair:

1. Go has built-in async runtime while this Rust implementation uses threads and mutex locks
2. The accept() is running in a single thread
3. The write operations lack buffering optimizations

These fundamental differences in implementation make it difficult to draw meaningful performance comparisons between the two approaches.

Perhaps a more apples-to-apples comparison would be to use async Rust (with tokio/async-std) or optimize the current implementation further.

Nevertheless, really appreciate the effort in creating these comparison videos! They help us learn a lot about different languages and approaches.

Автор

have you ever forgotten to turn off your ec2s and got a massive bill?

sathishkannan
Автор

I really want to run a comparison between Go and userver (C++) to see a difference in performance. userver is bluntly an implementaion of Go-like concurrency model using C++. Can I submit a PR to your repos if I get to testing userver?

cppcreate
Автор

looks like you forget --release for rust app

maxpetrov
Автор

Him using a semicolon instead of a colon in the timer feels wrong 😅

winterboltgames
Автор

This is just a click bait video. For the views, it is missleading for new devs. That is why almost every reply he does is "tokio is next". I would rather watch a 10-15 vidoes of both, than a missleading 5 min video.

Now, in the future where people are looking for rust vs go for webserver, this thing will show up. You should delete this video, it is useless; and edit your tokio video and includes this one first. A least it woll give the viewer a real context to the video --never try to use rust standard kibrary for webserver-- right now this is just a useless, inclomplete, missleading video.

You will get the same min views if you just add it to your upcoming video.

theangelofspace
Автор

Can you do a test giving both apps at least 2 cpus and have them interact with Postgres?

Godslar
Автор

Not a fair comparison. You're kinda comparing green thread vs os level thread. You will have to use async function in rust but then you need to use third party libraries to execute async functions.

ahmedaghadi
Автор

Thank you for the video. 🚀
Feel sorry for the rust fans crying in the comments.

eee
Автор

Can you please make a video about Quarkus ( virtual threads ) vs Go vs Rust

amiryosef
Автор

can you do a comparison between postgres and dynamodb? I would be interested to know how well it performs and how much it would cost... plus the vid would be useful to present as well :)

AdamPoniatowski
Автор

Use Jetty for Java along with the handlers it provides in a non-blocking mode. On the other side, put whatever you like. I promise you'll be amazed.

ahuramazda
Автор

Blud forgot the —release on the rust app 💀💀💀💀

jaaaj
Автор

I doubt the utility of this video to be honest as it is not really fair on so many levels. But at least it does highlight how good the stdlib of go is

lufenmartofilia
Автор

Please give Nim a shot too. It is very easy to write and performs very well.

PouriyaJamshidi
welcome to shbcf.ru