Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize memory usage #16

Merged
merged 2 commits into from
Oct 25, 2024
Merged

Conversation

clarkmcc
Copy link
Owner

@clarkmcc clarkmcc commented Oct 4, 2024

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 clarkmcc merged commit f99cdde into master Oct 25, 2024
4 checks passed
@clarkmcc clarkmcc deleted the fix-loading-two-typescript-versions branch October 25, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant