拡張機能研究所

Introducing recommended browser extensions in manga format!

2025/11/01 08:00

Intern's rewrite saves TikTok $300,000 per year!? Is Rust really that powerful?

When a TikTok intern rewrote part of a Go microservice in Rust, CPU usage and memory consumption dropped significantly. Here's an easy-to-understand explanation of how this resulted in annual server cost savings of $300,000.
Intern's rewrite saves TikTok $300,000 per year!? Is Rust really that powerful?

Ever thought 'Computers are so fast these days, minor optimizations don't really matter, right?' 💭
I used to think that too, but hearing about TikTok's story changed my perspective a bit ✨

Can an intern's work really make this much difference?

You can imagine TikTok uses tons of servers given its massive scale 👀
In that context, when an intern rewrote part of a CPU-intensive Go microservice in Rust, the numbers completely transformed ❣️

  • CPU usage dropped from 78.3% → 52%
  • Memory usage dramatically decreased from 7.4% → 2.07%
  • p99 latency (a measure of processing delay) shortened from 19.87ms → 4.79ms
  • And traffic handling capacity apparently doubled 😳

Just rewriting this small part made everything so much more efficient 💡

How much did they actually save?

With the system becoming this much lighter, they could reduce the number of required vCPU cores, which significantly cuts server maintenance costs 🥺
You might think 'For TikTok's scale, $300,000 (about ¥30 million) is just a rounding error, right?' but this was just from an intern rewriting part of one microservice

So while developer time is definitely valuable, this reminded me that it's worth taking the time to review things properly rather than being wasteful 😆

My thoughts

Go isn't exactly a slow language, but leveraging Rust's performance can make this much difference in efficiency 🎀
I tend to think 'Optimization is too much trouble, let's skip it,' but discoveries like this remind me that reviewing code is actually really important 🌸

Small adjustments can lead to big savings and performance improvements, so not only engineers but maybe we're all missing out on potential benefits without realizing it? 💬

It feels like getting a great deal, doesn't it? ✨

Show animated messageON
Wow, that's amazing savings! ✨

Comments

Ataror of Kingston

グレース

Don't rush into unnecessary optimizations—measure first and you'll get results like this.

Ataror of Robert

ロバート

The larger the scale, the bigger the savings—it's not about rewriting to Rust to save a few dollars.

Ataror of Brooklynn

ハンナ

They should have linked to the original blog post directly; this repurposed LinkedIn article is pretty weak.

Ataror of Nolan

ノーラン

Maybe the Go code wasn't written properly in the first place.

Ataror of Sadie

サム

Anyone who says 'computers are fast so we don't need optimization' is seriously out of their mind.

Ataror of Christian

クリス

The source of this 'news' is someone sharing content from a blog by someone claiming to be an amazing intern on LinkedIn.

Ataror of Luis

リリー

Was the high CPU usage due to GC? The author mentions flame graphs but doesn't show them. I'm curious about the criteria for moving to Rust.

Ataror of Caleb

クロエ

For TikTok, this is probably within the margin of error.

Ataror of Leo

レオ

You often hear 'switching to language X made it much faster,' but usually it's because the original code was terrible and rewriting had that effect.

Ataror of Brian

ミア

Optimization doesn't require genius—anyone can do it with time and space. But code written in a hurry is often inefficient.

Ataror of Kimberly

キンバリー

You don't even need to read the article to know that algorithms and strategy matter more than the language itself.

Ataror of Aidan

エイダン

In my first job, I pre-allocated and reused a 2MB buffer. Batch processing costs dropped by 90%, but the billing model was weird so we still lost money lol.

Ataror of Robert

ロバート

High-QPS microservices use resources for serialization, encryption, and thread switching. Google and Amazon have specialized teams for this.

Ataror of Christian

クリス

1) Encryption is increasingly moving to hardware. 2) 'Zero-copy' technology is also being researched where network cards read/write directly to app buffers. 3) Thread switching affects performance, but high-level language programmers don't notice. Rust and C++ let you control that, which is handy.

Ataror of Leo

レオ

To counter that point, TikTok might face costs for maintaining Rust expertise, but most companies hire generalists so it's not a huge issue. Though having Rust only in parts of the company could cause friction, if they have that strategy, it's probably a good thing.


PICKUP
Related Articles