go-typescript icon indicating copy to clipboard operation
go-typescript copied to clipboard

Optimize memory usage

Open clarkmcc opened this issue 1 year ago • 0 comments

This PR optimizes memory usage by doing a few things:

  • Removes the default registry, this way if you register your own version, you're not stuck also loading the latest version.
  • The registry lazily compiles by compiling Typescript only when a version is retrieved, not when it's registered.
  • A new registry ExpiringRegistry has been added which can cache a compiled Typescript transpiler for a configurable amount of time before freeing.

clarkmcc avatar Oct 04 '24 18:10 clarkmcc