Rust Rewrite Case Studies 2027: Discord, Cloudflare, Grab, Anthropic

Max WellsMax WellsFounder of Rustify
By Max Wells13 min read

By Max Wells, updated November 30, 2026

TL;DR: The best-documented Rust rewrites share one pattern: a single hot, long-lived component with a measurable cost problem, rewritten behind a stable contract and verified against the old system. Discord removed garbage collector latency spikes, Cloudflare cut proxy CPU by about 70%, Grab ran a Go service on about a fifth of the cores, and Anthropic cut CPU per request by about 70% after months of shadow-traffic verification. The counterexample matters too: Microsoft ported the TypeScript compiler to Go, not Rust, because a port beat a redesign.

  • What wins: hot paths, GC-sensitive services, memory-unsafe C or C++, per-request CPU at scale
  • What fails: whole-platform rewrites, rewrites justified only by "Rust is faster"
  • What the 2026 cases add: AI agents make writing Rust cheap; verification became the real cost
  • Rule of thumb: rewrite one component, keep the old one as the oracle, measure before and after

Who Should Read This?

This is for engineers and tech leads who need evidence, not slogans, before proposing a Rust rewrite at work.

Every company in this article published its own numbers, and every number below links to the original engineering post. Where a figure only appears in secondary coverage, it is marked as such. The goal is to show what each rewrite changed, what it measured, and what made it work, so you can tell whether your service looks like one of them.

If you are still deciding whether a rewrite makes sense at all, start with the decision framework in Should You Rewrite It in Rust?. This page is the evidence library behind that decision.

Which Companies Rewrote Services in Rust, and What Did They Measure?

Ten public rewrites cover four starting languages, and almost every one targeted a single component rather than a whole product.

CompanyFromWhat was rewrittenHeadline resultYear
DiscordGoRead States serviceNo GC latency spikes; better latency, CPU, memory2020
CloudflareNGINX (C, Lua)Edge HTTP proxy (Pingora)About 70% less CPU, 67% less memory, same traffic2022
DropboxPythonDesktop sync engine (Nucleus)Correctness and testability of a new data model2020
FigmaTypeScriptMultiplayer syncing engineServer kept up with growth2018
GrabGoCounter Service read path4.5 cores vs 20 at 1,000 QPS; 70% infra savings2025
fish shellC++Entire shellMostly invisible to users; easier concurrency work2025
PydanticPythonValidation core (pydantic-core)4x to 50x faster than V1 in its benchmarks2023
AndroidC and C++New code written in RustMemory safety bugs under 20% of total2025
GitHub CopilotTypeScriptShared agent runtimeSession lifecycle 5.25 s to 55.3 ms2026
AnthropicPythonMessages API request pathAbout 70% less CPU, 80%+ less memory per request2026

The pattern is clear before reading any detail. Nobody rewrote "the backend". They rewrote the one service where a garbage collector, an interpreter, a process model, or memory unsafety was a measured, recurring cost.

Why Did Discord Rewrite a Go Service in Rust?

Discord's Read States service had latency spikes about every two minutes, caused by Go's garbage collector scanning a huge in-memory cache, and Rust removed them.

Read States tracks which channels and messages every Discord user has read, and it sits in the hot path of every connection, message send, and message read. In the February 2020 post, Discord explains that Go forces a garbage collection run at least every two minutes, and that each run had to scan the entire LRU cache to prove memory was free.

The team tried to fix it in Go first. Changing the GC percent did nothing. Shrinking and partitioning the cache reduced the spikes but raised 99th percentile latency, because more reads fell through to the database. They tested Go 1.8, 1.9, and 1.10 without improvement.

The Rust port, completed in May 2019, "was just as good as Go's and had no latency spikes", and Discord says it beat Go "on every single performance metric": latency, CPU, and memory. Upgrading Tokio later gave additional CPU savings for free.

Go:    ____/\____/\____/\____/\____    spike every ~2 min (forced GC scans cache)
Rust:  ____________________________    no GC, flat latency, bigger cache possible

The transferable lesson is narrow and strong: when a large, long-lived in-memory structure meets a tracing garbage collector, tuning has a ceiling. Our Rust at Discord profile covers where Rust sits in their stack today.

What Did Cloudflare Gain by Replacing NGINX With Pingora?

Cloudflare reports about 70% less CPU and 67% less memory for the same traffic after replacing its NGINX-based proxy with Pingora, a Rust proxy it built in-house.

Cloudflare's Pingora post names two reasons for leaving NGINX: its worker-per-process model unbalanced load across CPU cores and limited connection reuse, and C is not memory safe. The new proxy shares connections across all threads, which Cloudflare credits for much of the saving.

That second point matters when you quote the number. The baseline was NGINX plus Lua modules, and the architecture changed along with the language. The honest reading is "a redesigned proxy in Rust used far fewer resources", not "Rust is 70% faster than C". Our Rust at Cloudflare article covers the wider footprint.

What Did Grab Learn Rewriting a Go Service in Rust?

Grab's Counter Service ran on 4.5 cores in Rust versus 20 in Go for the same 1,000 QPS, while P99 latency stayed about the same.

Grab's June 2025 post is the most useful modern Go to Rust case, because it reports what did not improve. The team rewrote the BatchRead path of a service that serves counters to ML models and fraud rules at tens of thousands of QPS at peak.

SignalGoRust
Cores at 1,000 QPS204.5
Infrastructure savingsBaseline70% (abstract)
P99 latency on shadow trafficBaseline"Similar (or perhaps even slightly worse)"

Grab explicitly marks the myth "Rust is blazingly fast, faster than Golang" as disproved for this service, and "Rust is more efficient" as true. Its selection criteria are worth copying: the service must be simple in functionality, carry enough traffic for savings to matter, and the team must be willing to learn Rust. Grab also writes that rewriting "solely for the purpose of rewriting it in Rust is not a strong enough business justification."

Why Did Dropbox, Figma, and fish Choose Rust?

These three rewrites were driven less by raw speed and more by correctness, concurrency, and the ability to keep a complex system maintainable.

  • Dropbox spent about four years rebuilding its desktop sync engine, Nucleus, and names the old data model as the root problem. Rust's type system let the team encode sync invariants, and a companion post shows how much of the effort went into testing.
  • Figma moved its multiplayer syncing engine from TypeScript to Rust because the single-threaded server could not keep up with user growth, and the post is candid about the downside: async Rust was hard at the time.
  • fish shell ported its whole C++ codebase to Rust and shipped it in fish 4.0 in February 2025. The project kept a mixed C++ and Rust codebase that stayed testable throughout, and the change was designed to be mostly invisible to users.

The common thread is incremental delivery. None of these teams stopped shipping for a big-bang cutover.

What Do Python to Rust Rewrites Look Like?

Python teams usually move one hot core into Rust behind the same Python API, and only rewrite a whole service when the per-request work dominates.

Pydantic is the textbook core rewrite. V2 moved validation into pydantic-core, a Rust library exposed through PyO3, and its benchmarks put V2 between 4x and 50x faster than V1 while users kept writing ordinary Python models. Astral's Ruff took the tool-level route: a Rust linter and formatter that it says runs 10x to 100x faster than Flake8 and Black.

Anthropic is the service-level case. Its first attempt moved model-output parsing into Rust and called it from Python, which cut CPU by only 8% to 10% because every token crossed the language boundary three times. The full rewrite of the request path delivered the large gains. Our Anthropic Messages API breakdown covers that story, and PyO3 for Python engineers covers the hybrid route.

How Did AI Agents Change Rust Rewrites in 2026?

In 2026, GitHub and Anthropic both used AI agents to write most of a Rust rewrite, and both found that proving equivalence, not writing code, became the bottleneck.

GitHub moved Copilot's shared runtime from TypeScript and Node.js to more than 800,000 lines of Rust across 128 pull requests, with agents writing most of the code, as covered in our Copilot runtime article. Anthropic's Rust version passed about 98% of its tests but matched Python on only about a quarter of live inputs, until a shadow-traffic verifier and agent loops brought the match rate to 99.6%.

Large-scale automated translation is also a research field now. DARPA's TRACTOR program funds automated C to Rust translation, and a Microsoft distinguished engineer's goal of removing C and C++ by 2030 was later clarified as a research project, not a Windows rewrite.

When Did a Team Choose Not to Use Rust?

Microsoft ported the TypeScript compiler to Go instead of Rust, because the team wanted a faithful port of an existing design, and Rust would have forced a redesign.

The TypeScript native port targets about 10x faster builds. The team explained that the compiler relies on garbage collection and cyclic data structures, and that they wanted code "algorithmically similar" to the existing one. In Rust, both would have required a redesign, turning a port into a rewrite measured in years.

This is the most useful counterexample in the whole list. Rust wins when the design can change to fit ownership. When the goal is to move a large, GC-shaped codebase with minimal behavior change, a garbage-collected native language can be the better call. Our tsc-rs analysis covers the community attempt to do it in Rust anyway.

What Do Successful Rust Rewrites Have in Common?

Every success above combined a narrow scope, a measurable baseline, an incremental rollout, and a way to compare the new system with the old one.

1. Narrow target      one service or core, not the platform
2. Measured pain      GC spikes, CPU bill, memory bugs, single thread
3. Stable contract    same API, same protocol, same Python interface
4. Oracle             old system runs side by side (shadow, replay, tests)
5. Gradual traffic    slices, flags, staged releases
6. Honest metrics     report what did NOT improve too
DriverGood fitWeak fit
Garbage collector latencyLarge in-memory caches, strict tail latencyTypical CRUD service with small heaps
CPU cost at scalePer-request or per-token work, high QPSLow-traffic internal tools
Memory safetyC and C++ parsers, network edgesCode already in a memory-safe language
ConcurrencySingle-threaded runtimes at their ceilingWorkloads that are already I/O bound
TeamVolunteers willing to learnMandated rewrite with no Rust reviewers

If your service sits in the "good fit" column for at least one row and you can describe the oracle, you have the shape of a defensible proposal. For the business side, see the Rust developer vs Go developer salary data and our Rust at FAANG overview.

Frequently Asked Questions

Discord rewrote its Read States service from Go to Rust because Go's garbage collector, forced to run at least every two minutes, had to scan a very large in-memory LRU cache and caused regular latency spikes that tuning could not remove. Discord tried GC settings, smaller caches, and three Go versions first. The Rust version, completed in May 2019, had no spikes and beat Go on latency, CPU, and memory.

Public Rust rewrites with published results include Discord, Cloudflare, Dropbox, Figma, Grab, Pydantic, the fish shell, GitHub with its Copilot runtime, and Anthropic with its Messages API, while Google reports that new Android code in Rust has far fewer memory safety bugs than C and C++. Almost all of them rewrote one hot component, such as a proxy, sync engine, or request path, rather than a whole product, and kept the rest of their stack.

No, a Rust rewrite is not always faster than Go, and Grab's 2025 Counter Service rewrite is the clearest public example: P99 latency stayed about the same or slightly worse, while the Rust version needed only 4.5 cores instead of 20 to serve 1,000 QPS. The typical win over Go is resource efficiency and predictable tail latency without garbage collector pauses, not dramatically faster typical requests. If your Go service is mostly I/O bound, expect a smaller cloud bill rather than a visible speed change for users.

"Rewrite it in Rust", often shortened to RIIR, is a community phrase for the habit of proposing to port existing software into Rust, sometimes as a sincere engineering argument about safety and performance, and sometimes as a joke about overenthusiastic Rust fans who suggest it for everything. Serious rewrites justify the cost with a measured problem such as garbage collector latency, CPU spend, or memory safety bugs. Grab put it bluntly: rewriting only to use Rust is not a business justification.

Microsoft chose Go for the TypeScript native port because the team wanted a faithful port that stayed algorithmically similar to the existing compiler, and the compiler relies heavily on garbage collection and cyclic data structures that Rust's ownership model would have forced it to redesign. A Rust version would have been a multi-year rewrite. The team still described Rust as an excellent language, just not for porting this particular codebase.

Published Rust rewrites range from months for one focused service to several years for a core product system: Anthropic moved public traffic about six months after its first Rust work in March 2026, Discord completed its initial Read States port in May 2019, and Dropbox spent about four years on its sync engine. The writing is rarely the slow part. Verification, rollout, and rebuilding internal libraries usually take longer than the code itself.

The Bottom Line

The public record on Rust rewrites is better than the online debate suggests. Discord, Cloudflare, Grab, and Anthropic all measured real resource and latency gains, and each picked one component with a clear, recurring cost. Grab and the TypeScript team supply the honest limits: Rust does not automatically beat Go on latency, and a GC-shaped codebase may be cheaper to port elsewhere.

If you want to propose a rewrite, copy the method, not the headline number: narrow target, measured baseline, the old system as the oracle, and gradual traffic.

Keep Reading

Sources

Keep learning

Continue with a related Rust guide

Browse all articles

Want a clear path to your Rust goals?

Fill out the form

Book your event

Rustify

Apply for Rustify Program

👉 We are selective about who we work with. This call is reserved for developers serious about advancing their career with Rust.

🎯 On this 30-min diagnostic call, you will get:
  • An honest assessment of where you are and what's blocking you
  • Direct feedback on whether Bootcamp or Mentorship is the right fit for you

⚡ Not everyone is accepted: We only work with motivated professionals ready to take action.

By entering your information, you agree that your data will be stored in accordance with our terms & privacy policy

November 2026

Sun

Mon

Tue

Wed

Thu

Fri

Sat

Please fill out the form before choosing your time slot.

Ready to Land a $80k+ Rust Job in the US or Europe?