Try Pro free

The Peterman Pod · 4 min · Nov 2, 2026

Rust won after performance and embedding tests tied

Stephen Toub built small prototypes in several languages and compared performance, working set and embeddability.

In this episode

Full analysis
  1. 11:27Incremental ports keep fast-moving products shippingPro pick 7 min
  2. 22:11End-to-end tests matter more than unit tests for a port6 min
  3. 49:55A Rust port cost $120,000 in model tokensPro pick 6 min
  4. 5:36Rust won after performance and embedding tests tied4 min
  5. 32:02Strict one-to-one ports limited agent scope4 min
  6. 42:15Most regressions were caught before pre-release3 min
  7. 1:00:01The port grew to three times its estimated size3 min
  8. 1:03:24A rewrite needs a measurable business return3 min
“they were both very much on par with each other across pretty much all the metrics.”
STStephen Toubat 8:46 · The Peterman Pod
8:46

Takeaways

  1. He tested TypeScript, Python, Go, C#, Java and Rust prototypes.
  2. Rust and C# were broadly even on performance and embeddability.
  3. Rust fit GitHub's existing skills and codebase better.

About this segment

Stephen Toub built small prototypes in several languages and compared performance, working set and embeddability. Rust and C# were broadly even, so GitHub's existing Rust expertise tipped the choice.

ST

Stephen Toub

Stephen Toub is a Distinguished Engineer at Microsoft.

  • Ryan Peterman, Host · Host, The Peterman Pod

    Went from new grad to staff engineer at Instagram in three years.

From “Microsoft Distinguished Eng: Why And How To Port Your Entire Codebase to Rust | Stephen Toub”, Nov 2, 2026. Watch the full episode

Transcript

Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.

  1. 5:43

    I set out to move away from Node.js and V8. And that makes me wonder, if you didn't need to go to Rust, did you consider other alternatives? And why did you end up going to Rust specifically? So the very first thing I did was basically create a prototype agentically, because you can now create prototypes super fast in, um, still with TypeScript, but with different runtimes. So, you know, node versus bond versus whatever, uh, as well as I think I did Python, go C sharp, Java, and rust, um, and created a very small end to end sort of steel thread through uh one of these systems kind of backed by a local um chat completion you know dummy server um probably five to ten thousand lines for each of them uh and looked at them in terms of end-to-end performance uh in terms of uh working set throughput uh what kind of scale

  2. 6:50

    that we could get if we threw a lot of load at it and then also what kind of whether it could actually meet requirements and what it would take for someone for us with we have currently have six language sdks that are thin bindings on cross on top of the copilot runtime what it would look like for this to be usable from all of those and in particular right now because we don't want to force or previously because we didn't want to force node uh into the consuming applications process the the sdk basically spawned another process to host the the actual execution of the sessions but we'd really like as an option for it to be in proc as well like pretty much every other library in the world um and so basically evaluating all of these languages stages and runtimes against these performance goals and constraints, and just looking at

  3. 7:47

    the data to see what worked and then how well it worked. And for the most part, TypeScript and Python were very quickly out from, uh, kind of all of the performance perspective and the embeddability goals. Go had pretty good perf and, you know, had a pretty clean code base, but it's not really designed for embeddability. It's not real. Like Interop is not its raison d'etre, right? It's, you can do it, but you're kind of cutting against the grain.

  4. 8:30

    And then, and Java is also not, not great for that. Java's perf was okay. The two main contenders ended up being C-sharp, in particular C-sharp with native AOT, so that it could be compiled ahead of time down to assembly and, and Rust. And from a perf perspective, they were both very much on par with each other across pretty much all the metrics. In some places, Rust was a little better. In some places, C-sharp was a little better. And so to your question earlier, if the project was already in C-sharp, we wouldn't be having this conversation. We would have stayed with it. There would have been no reason to rewrite it. But it wasn't. And so that it came down to these criteria. So from a perf perspective, they both look good. From an embeddability perspective, they both look good. C-sharp has

  5. 9:25

    very strong interop characteristics as well. And then it came down to primarily softer factors. So there are other projects around GitHub in particular that are built in Rust and very few that are implemented in C Sharp. There are more people around GitHub that know Rust and fewer that know C Sharp. That's not the case within Microsoft, obviously, but within GitHub. And so factoring in those kinds of criteria, we ended up going with Rust. I know Anders recently did, I think the