# A Rust port cost $120,000 in model tokens

Markdown copy of https://realalpha.app/s/a-rust-port-cost-120-000-in-model-tokens/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Stephen Toub](https://realalpha.app/people/stephen-toub/) · Stephen Toub is a Distinguished Engineer at Microsoft.
- Host: [Ryan Peterman](https://realalpha.app/people/ryan-peterman/) · Host, The Peterman Pod · Went from new grad to staff engineer at Instagram in three years.
- Show: The Peterman Pod
- Episode: [Microsoft Distinguished Eng: Why And How To Port Your Entire Codebase to Rust | Stephen Toub](https://realalpha.app/v/PLMOVlZC4eU/), Nov 2, 2026
- Moment: 49:55 to 56:18 of the episode (6 min), playing on https://realalpha.app/s/a-rust-port-cost-120-000-in-model-tokens/; the episode from there: https://realalpha.app/v/PLMOVlZC4eU/?t=2995

## Quote

> “all told, it was about **136 billion tokens** broken up in such a way”
> — [Stephen Toub](https://realalpha.app/people/stephen-toub/) at [53:41](https://realalpha.app/v/PLMOVlZC4eU/?t=3221) · The Peterman Pod

## Takeaways

1. The port consumed about 136 billion tokens.
2. The token bill was about $120,000 at public pricing.
3. Toub estimates roughly three weeks of his time across three months.

## About this segment

Stephen Toub weighs the shared-runtime and performance gains against the cost: about $120,000 in public model pricing and roughly three weeks of his time. The improved performance made the business value substantial.

From “Microsoft Distinguished Eng: Why And How To Port Your Entire Codebase to Rust | Stephen Toub”, Nov 2, 2026. [Watch the full episode](https://realalpha.app/v/PLMOVlZC4eU/)

## Transcript

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

[50:02](https://realalpha.app/v/PLMOVlZC4eU/?t=3002) I used initially. So after you finish the rewrite, what was the concrete impact and the cost? So if you look at it from a business perspective, what was the benefit and the cost of this project? So the benefits are STARK. I mean, the benefits are the ability for all these products and services and teams across GitHub and Microsoft to be able to rely on a shared harness that is constantly sort of, you know, best of breed and getting better and better every day.

[50:41](https://realalpha.app/v/PLMOVlZC4eU/?t=3041) and not have to spend their own resources trying to do the same thing they can focus on their business value and and reuse this component it's the same as with any library that you want to rely on and this library is a particularly large library right you want to be able to focus on your business value and reuse the constantly evolving work for someone that is spending all their time focusing on on that thing and so from a business value perspective it's it's like incalculable across github and microsoft being able to leverage this shared harness whereas before the port a lot of that would have been a harder sell and harder to justify and um part of that is because of very real uh costs uh like performance costs so you know something that was taking 10 times as much working set waving my hands means 10 times less density which means 10

[51:46](https://realalpha.app/v/PLMOVlZC4eU/?t=3106) times as many servers you know those sorts of things um and uh if you can you know make the um if you can scale the number of users If you're able to be on the same machine running concurrently, that has impacts on your bottom line. If you can scale the throughput and reduce the latency by 5 or 6x or whatever it is, that has real benefits. One of the biggest impacts from a perf perspective, a lot of these systems, especially services, a request will come in and the agent loop needs to be started to make one more turn, which could be a very short thing, and then the request is done.

[52:36](https://realalpha.app/v/PLMOVlZC4eU/?t=3156) And so for these things, the startup cost ends up being one of the dominant factors and the startup of a node application versus the startup of a native Rust or C application is there's a big difference there. We're talking hundreds and hundreds of milliseconds difference, or in some cases, seconds. On a per request basis, that latency can be extremely measurable and extremely impactful for bottom line if you're even able to adopt it, because you might not be able to, and then you're back in the previous world that I was talking about.

[53:17](https://realalpha.app/v/PLMOVlZC4eU/?t=3197) From a business perspective, it's worth a lot to do this port. Um, in terms of what it actually cost us, um, it was about if I, so I, I stored all of my session logs or 99% of my session logs from this effort. And from those session logs, I was then able to sort of deduce the token counts for fresh tokens, cash rights, cash reads, uh, output tokens. And all told, it was about 136 billion tokens broken up in such a way that if you were to use the public pricing of those models at those times, it came out to approximately $120,000.

[54:07](https://realalpha.app/v/PLMOVlZC4eU/?t=3247) This is not factoring any discounts or things that companies might have for what those tokens cost. um and uh this is just sort of what's on the website of you know open ai and anthropic plus my time which you know the it took it was about 14 15 weeks um but i was doing other things at the same time you know a lot of these uh agentic projects if i look at my my co-pilot app that i currently have on my screen I've got about 35 sessions right now for things that I'm working on some of them in the same area some of them are across different projects and so I'm not developers are no longer working on one thing at a time so if you look at the percentage you just as a rough estimate for my time if you look at the percentage of PRs that I was submitting over that same period about a fifth of them give or take was to do with this this project and about

[55:11](https://realalpha.app/v/PLMOVlZC4eU/?t=3311) 80 was for other things um and so if you figure you know about 20 of about 15 weeks you end up with about three weeks of my time spread out over three months um plus the the token costs um and it's only getting cheaper the the the models are becoming like at cheaper at an astronomical rate i think like when open ai released i'm not gonna remember the exact things but i think like six one sol is half the price of six sol and six was half the price of five six salt like the it's just getting cheaper and cheaper and cheaper um and the models are also getting better and better and better, which means that the amount of time that I need to put in to steer the models to do.

[56:00](https://realalpha.app/v/PLMOVlZC4eU/?t=3360) right thing is also decreasing. Um, and so the costs of these ports, the cost of these migrations is only getting cheaper over time. Wow. So three weeks of, uh, I guess of developers time,
