DEV Community

Cover image for TSGo: The Future of TypeScript with Native Performance Boost
Taki
Taki

Posted on

TSGo: The Future of TypeScript with Native Performance Boost

Microsoft's introduction of a TypeScript native port (TSGo) marks a major shift in how the TypeScript compiler (tsc) operates. This new native implementation is designed to improve performance, memory efficiency, and scalability, particularly for large codebases.


๐Ÿš€ Why TSGo?

Currently, TypeScript (tsc) runs on Node.js, which means its performance is limited by JavaScriptโ€™s execution constraints. The new native port (TSGo) aims to rewrite TypeScript in a compiled language, leading to significant speed improvements and lower resource usage.


๐Ÿ“Œ Key Benefits of TypeScript Native Port (TSGo)

โœ… Faster Compilation: Up to 10x speed improvements in large projects.

โœ… Lower Memory Usage: Optimized memory handling in native execution.

โœ… Better Editor Performance: Faster IntelliSense and language services.

โœ… Scalability: Handles large codebases more efficiently.

๐Ÿ’ก Example Performance Benchmarks:

Project Lines of Code (LOC) Old tsc (JavaScript) New tsc (TSGo) Speedup
VS Code 1,505,000 77.8s 7.5s 10.4x
Playwright 356,000 11.1s 1.1s 10.1x
TypeORM 270,000 17.5s 1.3s 13.5x

๐ŸŽฏ How Will This Affect Developers?

1๏ธโƒฃ Faster Compilation in Large Projects

In current TypeScript (tsc), compiling a large project can take minutes. With TSGo, itโ€™s nearly instant.

Example Before (Slow Compilation in JavaScript)

# Running tsc (old JavaScript-based compiler)
tsc --project tsconfig.json
# Takes ~20 seconds for a large project
Enter fullscreen mode Exit fullscreen mode

Example After (TSGo - Native Compilation)

# Running the new native TypeScript compiler
tsgo --project tsconfig.json
# Takes ~2 seconds for the same project (10x faster)
Enter fullscreen mode Exit fullscreen mode

2๏ธโƒฃ Faster Type Checking in Editors (VS Code, WebStorm, etc.)

Currently, when editing a large TypeScript file, IntelliSense may lag. TSGo aims to eliminate this lag by making the TypeScript language service native and faster.

Before (Current TypeScript in VS Code)

// Large TypeScript file (1000+ lines)
function processData(input: string): string {
  return input.toUpperCase();
}

const result = processData("hello");
console.log(result); // HELLO

// When changing types, VS Code takes time to update hints
Enter fullscreen mode Exit fullscreen mode

After (With TSGo - Instant Type Checking)

With TSGo, type checking in editors will be much faster, making large files easier to work with.


3๏ธโƒฃ Improved Performance for TypeScript Build Pipelines

Before (Old TypeScript Build)

{
  "scripts": {
    "build": "tsc -p tsconfig.json"
  }
}
Enter fullscreen mode Exit fullscreen mode

โณ Slow Build (~20 seconds)

After (New TSGo Build)

{
  "scripts": {
    "build": "tsgo -p tsconfig.json"
  }
}
Enter fullscreen mode Exit fullscreen mode

โšก Fast Build (~2 seconds, 10x faster!)


๐Ÿ”ฎ Whatโ€™s Next? (TSGo Roadmap)

  • Mid-2025: Public preview of the new native TypeScript compiler (tsgo).
  • End of 2025: Fully functional TSGo release with project builds & language services.

๐Ÿ‘จโ€๐Ÿ’ป You Can Try It Now!

Microsoft has released a GitHub repository with an early version of TSGo. Developers can start experimenting with the new compiler.


๐ŸŽ‰ Final Thoughts

TSGo is a game-changer for TypeScript. It will bring 10x performance improvements, faster builds, and smoother editing in VS Code. If you work with large TypeScript projects, TSGo will save you time and improve productivity.

Top comments (0)