AI
GitHub Completes Major Rust Migration of Copilot Runtime, Halving Startup Time
Using AI-assisted code generation and an incremental replacement strategy, GitHub rewrote over 800,000 lines of its Copilot runtime from TypeScript to Rust, dramatically improving performance while maintaining compatibility.
InfoQ
GitHub has successfully transitioned the core runtime powering GitHub Copilot CLI, the Copilot app, and Copilot SDK from TypeScript and Node.js to Rust—replacing more than 800,000 lines of production code in an approximately 14.5-week effort. The rewrite was accomplished through AI-assisted code generation paired with human oversight, delivered across 128 pull requests while the service remained operational.
Performance gains drive the overhaul#
The most visible outcome is a dramatic performance improvement. Client startup, session creation, and single-turn interactions dropped from 5.25 seconds to 292 milliseconds when the new Rust runtime runs in-process—nearly an 18-fold acceleration. The shift also eliminates the memory overhead of the previous architecture: because the old Node.js-based implementation required a separate process boundary and V8 runtime, each client consumed roughly 100 MB of additional working set.
A hybrid deployment model replaces the Node boundary#
The Rust version introduces architectural flexibility. Rather than forcing cross-process communication, the new runtime can be embedded directly into host applications via a C ABI interface, shrinking both latency and memory footprint. An out-of-process mode remains available for cases where isolation is preferred. The Copilot SDK continues to support TypeScript, Python, Go, .NET, Java, and Rust, so developers can integrate the runtime through their language of choice.
Incremental rewrite reduced risk#
GitHub avoided the hazard of a risky "big bang" cutover by adopting an incremental strategy instead. Individual TypeScript components were progressively replaced with Rust equivalents, with temporary Node API interoperability bridges keeping the two runtimes connected during the transition. This allowed end-to-end tests to continuously validate both old and new code paths.
The approach paid off: during the 14.5-week effort, GitHub shipped 135 releases, including 35 stable versions and 100 prerelease builds. The internal compatibility layer grew to 2,019 N API exports and 3,356 TypeScript call sites before being fully removed. By late August, the codebase contained 832,378 lines of production Rust alongside 468,689 lines of Rust unit tests.

