For fourteen months I built an AI platform in C# and .NET: about 2,650 hours, 7,600 commits and 40 projects. On 10 November 2026 I stopped all C# development and started over in TypeScript on Bun. Two days later version 3.0 was tagged and running in the test environment.
It sounds like a do-over. It wasn’t. It was the best technical decision I’ve made this year, and these are the numbers behind it.
Why switch?
C# is a good language and .NET is a mature platform. But the platform had become heavy to work in. Every change went through a build of about 11 minutes, often after half an hour in the queue. Forty projects, layer upon layer of Domain, Application, Infrastructure and Presentation, dependency injection, an ORM, Serilog with seven packages, Quartz and Polly. All sensible choices on their own. Together, a machine where even small changes cost time.
I had worked with Node and JavaScript at DR, the Danish public broadcaster, and remembered how fast it is to start and run. The question was whether that lightness would hold all the way into a product with real demands on security, personal data and operations.
The measurements
All figures are measured on the same platform before and after: the last C# version (12 November 2026) against TypeScript version 3.0.10 (15 November 2026). Lines are counted with wc -l, excluding generated and vendored code.
| C# / .NET | TypeScript / Bun | Change | |
|---|---|---|---|
| Server code | 236,814 lines, 1,924 files, 40 projects | 53,044 lines, one package | −78 % |
| Whole product | about 360,000 lines | 126,134 lines | −65 % |
| SQL | 13,551 lines | 5,272 lines | −61 % |
| External server dependencies | 52 NuGet packages (central package list) | 5 npm packages | −90 % |
| Build | about 11 min (plus about 35 min queue) | about 3 min, no queue | ~4× faster |
| Shared core library, build | 7–10 min | about 30 s | ~15× faster |
| Full end-to-end qualification | 45–50 min | about 8.5 min | ~5× faster |
| Container in the test environment | 2.5 CPU / 5 GiB | 1 CPU / 2 GiB | −60 % |
| Idle memory | not measured | 45–155 MiB | |
| Container image | not measured | 96 MB |
A few caveats, because numbers without caveats are advertising:
- The frontend was already TypeScript. It shrank by only 7 %. The gain is on the server.
- Qualification ran 51 user journeys in C# and 36–38 in TypeScript. Per journey it is still markedly faster, but not five times.
- Memory is not a like-for-like comparison. The C# figures I have were measured under load (400–840 MB), the TypeScript figures at idle. What is directly comparable is what the container had to be given to run stably: from 5 GiB to 2 GiB.
- A rewrite is always a second system. I knew the domain, the requirements and the mistakes from the first time. That explains part of the speed, but not build times, dependencies and container sizes.
Startup: JIT against a runtime that just starts
The difference I felt most day to day was startup. I don’t have a clean measurement of it, only observations, so take it for what it is.
A .NET application starts by loading the runtime and its assemblies, building the dependency injection container and JIT-compiling code as it is used. Tiered compilation makes this faster than it used to be, and AOT compilation can make it much faster, but an ordinary ASP.NET application with many projects and packages still spends seconds getting ready. In one of our job runs, about 12 seconds went to composing the .NET host alone, before any real work began. Our health checks had been allowed to wait up to 10 minutes for cold pods.
Bun is built on JavaScriptCore, Safari’s engine, which is optimised to start fast. Bun runs TypeScript directly without a separate compile step, and there is no DI container building an object graph. The process starts, reads its configuration once and listens. It isn’t magic; there is simply much less to do.
When we update the test environment, the platform is down for 36–40 seconds and answers again within a minute and a half. That includes Azure scheduling the container and pulling the image. The process itself is the smallest part of it.
Where did the 180,000 lines go?
Not into features: the user journeys are the same, and they are still qualified end to end before every release. The lines disappeared from the structure around the code:
- The layers. Domain, Application, Infrastructure and Presentation became one package of modules that call each other directly.
- Dependency injection. Replaced by plain functions and a configuration that is read and type-checked at startup.
- The ORM. Replaced by SQL written directly with postgres.js. That also shrank the SQL, because migrations no longer have to match an object model.
- Logging and retry frameworks. One JSON line per event and an outbox do what we actually used them for.
Dependencies are security too
Going from 52 external server packages to 5 doesn’t just make builds faster. It means fewer things that can carry a vulnerability. The C# repository has 321 commits that update dependencies, and several of them close concrete CVEs in runtime packages. Every update is a build, a test and a release.
With five packages I can name them all: Azure Service Bus, jose for tokens, openid-client for sign-in, postgres for the database and long for 64-bit integers. When you can name every dependency of your server, you are in a different security position than with 52 packages and everything they pull in.
It matters more when agents write the code
I no longer write most of the code myself. A team of AI agents writes it, and I orchestrate, review and decide. Here the difference grows. An agent that waits 11 minutes for a build and 45 minutes for qualification gets few iterations a day. With 3 and 8 minutes it gets many. Less code also means an agent can hold more of the system in its head at once, and makes fewer mistakes.
In the 17 days after the switch, 4,395 commits were made across the platform’s repositories.
When does it not make sense?
.NET is still a strong choice for long-running processes with heavy CPU work, where the JIT has time to optimise, and for teams with deep .NET experience and a large existing codebase. I wouldn’t advise a bank to rewrite a well-functioning core service to save build time.
But for a product platform that changes every day, built by a small team and a crew of agents, in containers that start and stop, the switch was right. The numbers aren’t a gut feeling. They are measured.