{"id":4567,"date":"2025-03-11T06:31:27","date_gmt":"2025-03-11T14:31:27","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/typescript\/?p=4567"},"modified":"2025-03-11T06:31:27","modified_gmt":"2025-03-11T14:31:27","slug":"typescript-native-port","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/typescript\/typescript-native-port\/","title":{"rendered":"A 10x Faster TypeScript"},"content":{"rendered":"<p>Today I&#8217;m excited to announce the next steps we&#8217;re taking to radically improve TypeScript performance.<\/p>\n<p><iframe title=\"A 10x Faster TypeScript\" src=\"https:\/\/www.youtube.com\/embed\/pNlq-EVld70?si=OaEgTg6ROtfYDYLt\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>The core value proposition of TypeScript is an excellent developer experience.\nAs your codebase grows, so does the value of TypeScript itself, but in many cases TypeScript has not been able to scale up to the very largest codebases.\nDevelopers working in large projects can experience long load and check times, and have to choose between reasonable editor startup time or getting a complete view of their source code.\nWe know developers love when they can rename variables with confidence, find all references to a particular function, easily navigate their codebase, and do all of those things without delay.\nNew experiences powered by AI benefit from large windows of semantic information that need to be available with tighter latency constraints.\nWe also want fast command-line builds to validate that your entire codebase is in good shape.<\/p>\n<p>To meet those goals, we&#8217;ve begun work on a native port of the TypeScript compiler and tools.\nThe native implementation will <strong>drastically improve editor startup, reduce most build times by 10x, and substantially reduce memory usage<\/strong>.\nBy porting the current codebase, we expect to be able to preview a native implementation of <code>tsc<\/code> capable of command-line typechecking by mid-2025, with a feature-complete solution for project builds and a language service by the end of the year.<\/p>\n<p>You can <strong><a href=\"https:\/\/github.com\/microsoft\/typescript-go\">build and run the Go code from our new working repo<\/a><\/strong>, which is offered under the same license as the existing TypeScript codebase.\nCheck the README for instructions on how to build and run <code>tsc<\/code> and the language server, and to see a summary of what&#8217;s implemented so far.\nWe&#8217;ll be posting regular updates as new functionality becomes available for testing.<\/p>\n<h2 id=\"how-much-faster\">How Much Faster?<\/h2>\n<p>Our native implementation is already capable of loading many popular TypeScript projects, including <a href=\"https:\/\/github.com\/microsoft\/TypeScript\/tree\/main\/src\/compiler\">the TypeScript compiler itself<\/a>.\nHere are times to run <code>tsc<\/code> on some popular codebases on GitHub of varying sizes:<\/p>\n<table>\n<thead>\n<tr>\n<th>Codebase<\/th>\n<th style=\"text-align: right;\">Size (LOC)<\/th>\n<th style=\"text-align: right;\">Current<\/th>\n<th style=\"text-align: right;\">Native<\/th>\n<th style=\"text-align: right;\">Speedup<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/github.com\/microsoft\/vscode\">VS Code<\/a><\/td>\n<td style=\"text-align: right;\">1,505,000<\/td>\n<td style=\"text-align: right;\">77.8s<\/td>\n<td style=\"text-align: right;\">7.5s<\/td>\n<td style=\"text-align: right;\">10.4x<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/microsoft\/playwright\">Playwright<\/a><\/td>\n<td style=\"text-align: right;\">356,000<\/td>\n<td style=\"text-align: right;\">11.1s<\/td>\n<td style=\"text-align: right;\">1.1s<\/td>\n<td style=\"text-align: right;\">10.1x<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/typeorm\/typeorm\">TypeORM<\/a><\/td>\n<td style=\"text-align: right;\">270,000<\/td>\n<td style=\"text-align: right;\">17.5s<\/td>\n<td style=\"text-align: right;\">1.3s<\/td>\n<td style=\"text-align: right;\">13.5x<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/date-fns\/date-fns\">date-fns<\/a><\/td>\n<td style=\"text-align: right;\">104,000<\/td>\n<td style=\"text-align: right;\">6.5s<\/td>\n<td style=\"text-align: right;\">0.7s<\/td>\n<td style=\"text-align: right;\">9.5x<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/trpc\/trpc\">tRPC<\/a> (server + client)<\/td>\n<td style=\"text-align: right;\">18,000<\/td>\n<td style=\"text-align: right;\">5.5s<\/td>\n<td style=\"text-align: right;\">0.6s<\/td>\n<td style=\"text-align: right;\">9.1x<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/ReactiveX\/rxjs\">rxjs<\/a> (observable)<\/td>\n<td style=\"text-align: right;\">2,100<\/td>\n<td style=\"text-align: right;\">1.1s<\/td>\n<td style=\"text-align: right;\">0.1s<\/td>\n<td style=\"text-align: right;\">11.0x<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>While we&#8217;re not yet feature-complete, these numbers are representative of the order of magnitude performance improvement you&#8217;ll see checking most codebases.<\/p>\n<p>We&#8217;re incredibly excited about the opportunities that this massive speed boost creates. Features that once seemed out of reach are now within grasp.\nThis native port will be able to provide instant, comprehensive error listings across an entire project, support more advanced refactorings, and enable deeper insights that were previously too expensive to compute.\nThis new foundation goes beyond today&#8217;s developer experience and will enable the next generation of AI tools to enhance development, powering new tools that will learn, adapt, and improve the coding experience.<\/p>\n<h2 id=\"editor-speed\">Editor Speed<\/h2>\n<p>Most developer time is spent in editors, and it&#8217;s where performance is most important.\nWe want editors to load large projects quickly, and respond quickly in all situations.\nModern editors like Visual Studio and Visual Studio Code have excellent performance as long as the underlying language services are also fast.\nWith our native implementation, we&#8217;ll be able to provide incredibly fast editor experiences.<\/p>\n<p>Again using the Visual Studio Code codebase as a benchmark, the current time to load the entire project in the editor on a fast computer is about 9.6 seconds.\nThis drops down to about 1.2 seconds with the native language service, an <strong>8x improvement in project load time<\/strong> in editor scenarios.\nWhat this translates to is a faster working experience from the time you open your editor to your first keystroke in any TypeScript codebase.\nWe expect all projects to see this level of improvement in load time.<\/p>\n<p>Overall memory usage also appears to be roughly half of the current implementation, though we haven&#8217;t actively investigated optimizing this yet and expect to realize further improvements.\nEditor responsiveness for all language service operations (including completion lists, quick info, go to definition, and find all references) will also see significant speed gains.\nWe&#8217;ll also be moving to the Language Server Protocol (LSP), a longstanding infrastructural work item to better align our implementation with other languages.<\/p>\n<h2 id=\"versioning-roadmap\">Versioning Roadmap<\/h2>\n<p>Our most recent TypeScript release was TypeScript 5.8, with TypeScript 5.9 coming soon.\nThe JS-based codebase will continue development into the 6.x series, and TypeScript 6.0 will introduce some deprecations and breaking changes to align with the upcoming native codebase.<\/p>\n<p>When the native codebase has reached sufficient parity with the current TypeScript, we&#8217;ll be releasing it as <strong>TypeScript 7.0<\/strong>.\nThis is still in development and we&#8217;ll be announcing stability and feature milestones as they occur.<\/p>\n<p>For the sake of clarity, we&#8217;ll refer to them simply as TypeScript 6 (JS) and TypeScript 7 (native), since this will be the nomenclature for the foreseeable future.\nYou may also see us refer to &#8220;Strada&#8221; (the original TypeScript codename) and &#8220;Corsa&#8221; (the codename for this effort) in internal discussions or code comments.<\/p>\n<p>While some projects may be able to switch to TypeScript 7 upon release, others may depend on certain API features, legacy configurations, or other constraints that necessitate using TypeScript 6.\nRecognizing TypeScript&#8217;s critical role in the JS development ecosystem, we&#8217;ll still be maintaining the JS codebase in the 6.x line until TypeScript 7+ reaches sufficient maturity and adoption.<\/p>\n<p>Our long-term goal is to keep these versions as closely aligned as possible so that you can upgrade to TypeScript 7 as soon as it meets your requirements, or fall back to TypeScript 6 if necessary.<\/p>\n<h2 id=\"next-steps\">Next Steps<\/h2>\n<p>In the coming months we&#8217;ll be sharing more about this exciting effort, including deeper looks into performance, a new compiler API, LSP, and more.\nWe&#8217;ve written up some <a href=\"https:\/\/github.com\/microsoft\/typescript-go\/discussions\/categories\/faqs\">FAQs<\/a> on the GitHub repo to address some questions we expect you might have.\nWe also invite you to join us for an AMA at the <a href=\"https:\/\/discord.gg\/typescript\">TypeScript Community Discord<\/a> at <strong>10 AM PDT | 5 PM UTC<\/strong> on March 13th.<\/p>\n<p>A 10x performance improvement represents a massive leap in the TypeScript and JavaScript development experience, so we hope you are as enthusiastic as we are for this effort!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I&#8217;m excited to announce the next steps we&#8217;re taking to radically improve TypeScript performance. The core value proposition of TypeScript is an excellent developer experience. As your codebase grows, so does the value of TypeScript itself, but in many cases TypeScript has not been able to scale up to the very largest codebases. Developers [&hellip;]<\/p>\n","protected":false},"author":177643,"featured_media":4666,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4567","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-typescript"],"acf":[],"blog_post_summary":"<p>Today I&#8217;m excited to announce the next steps we&#8217;re taking to radically improve TypeScript performance. The core value proposition of TypeScript is an excellent developer experience. As your codebase grows, so does the value of TypeScript itself, but in many cases TypeScript has not been able to scale up to the very largest codebases. Developers [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/4567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/users\/177643"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/comments?post=4567"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/4567\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/media\/4666"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/media?parent=4567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/categories?post=4567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/tags?post=4567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}