Rust vs. Go (Golang): Performance 2025
AI Summary
This video compares Rust and Go performance using the Hyper HTTP server library on AWS EC2 instances, measuring throughput, latency, CPU, and memory usage.
Rust uses Hyper with Tokyo runtime; Go is tested on same infrastructure (M7A large EC2, systemd, EKS cluster).
Rust achieved nearly 160,000 requests per second using only two CPUs, outperforming Go and all other tested applications.
Rust had better p90 latency than Go.
Rust used less CPU than Go for the same workload.
Memory was measured but deemed less important for this comparison.
Rust with Hyper significantly outperforms Go in throughput, latency, and CPU efficiency, making it the fastest tested web server framework.
Clickbait Check
90% Legit"Title accurately reflects the content: a performance comparison of Rust vs Go in 2025."
Study Flashcards (4)
Which HTTP server library did Rust use in the benchmark?
easy
Click to reveal answer
Which HTTP server library did Rust use in the benchmark?
Hyper, based on the Tokyo asynchronous runtime.
00:00
What was Rust's throughput in requests per second?
medium
Click to reveal answer
What was Rust's throughput in requests per second?
Almost 160,000 requests per second using only two CPUs.
02:27
Which metrics were measured in the benchmark?
easy
Click to reveal answer
Which metrics were measured in the benchmark?
Throughput (requests per second), latency (p90 percentile), CPU usage, and memory usage.
00:57
How did Rust compare to Go in CPU usage?
medium
Click to reveal answer
How did Rust compare to Go in CPU usage?
Rust used less CPU than Go.
02:57
🔥 Best Moments
Rust's Record Throughput
Rust reached nearly 160,000 requests per second, the highest the tester has seen across all languages.
02:27Latency Dominance
Rust outperformed Go in latency, a critical metric for web servers.
02:43Challenge to Viewers
The presenter asks viewers to suggest languages or runtimes that can compete with Rust.
03:10Full Transcript
Download .txt[00:00] In this video, we'll compare Rust with Go, but this time using the most performant HTTP server library Hyper, which is based on the Tokyo asynchronous runtime. If you want to build
[00:13] any web application, Tokyo runtime has become de facto standard and many frameworks such as Exum actually built on Hyper and Tokyo. Hyper is in fact the fastest framework I've tested
[00:26] across all languages over the last year. I run all my tests on AWS and in this video I use exactly the same infrastructure as in the previous one. I use M7A large EC2 instances and run applications
[00:42] using systemd service files while my clients and monitoring agents run on EKS cluster. All right, let's go ahead and run the test. It took around 2 hours and I compressed it to just a few minutes
[00:57] while editing. So we measure latency using p90 percentile, throughput which is requests per second, as well as CPU usage and memory. This is the memory usage of the entire VM, so it might not
[01:11] be as accurate as when I measured from the containers running in Kubernetes. As always, let me run this test for one more minute and we'll go over each graph one by one at the end of the test.
[01:47] I sorry Thank you
[02:10] Alright, first we have Threadput, which is measured as requests per second. Go reached
[02:27] the same level as in the previous video, but Rust, once again, is the best and fastest application I've tested so far. It reached almost 160,000 requests per second using only two CPUs. None of
[02:43] the other applications ever came close. Well, maybe Zeke was the closest one. Next, we have latency, which is one of the most important metrics. And again, Rust performed better than Go in this test.
[02:57] Next, we have CPU usage, and you can see that Rust is more efficient using less CPU than Go application. And finally, memory usage, which is not really important for this video.
[03:10] So let me know which language or runtime can compete with Rust, and if you can help to develop a simple web server in that language, it would be great. I have other benchmarks that you might find interesting such as Postgres vs MySQL, Redis vs Memcached and others.