Skip to content

refactor(tsc): remove TS program creation during snapshotting #27797

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

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

bartlomieju
Copy link
Member

This commit refactors how a snapshot is created for the TypeScript compiler.

Instead of having 4 ops, only a single op ("op_load") is left. This is achieved
by not creating a "ts.Program" during snapshotting, that during benchmarking
doesn't provide much benefit.

This greatly simplifies build script for the TS snapshot and opens up way to simplify
it even further in follow up PRs.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -277,6 +230,28 @@ mod ts {
)
.unwrap();

// Leak to satisfy type-checker. It's okay since it's only run once for a build script.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type -> borrow checker?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix it up in a follow up

@bartlomieju bartlomieju merged commit ad50c0d into denoland:main Jan 24, 2025
17 checks passed
@bartlomieju bartlomieju deleted the tsc_remove_snapshotted_program branch January 24, 2025 12:06
bartlomieju added a commit that referenced this pull request Jan 30, 2025
This commit refactors how a snapshot is created for the TypeScript
compiler.

Instead of having 4 ops, only a single op ("op_load") is left. This is
achieved by not creating a "ts.Program" during snapshotting, that during
benchmarking doesn't provide much benefit.

This greatly simplifies build script for the TS snapshot and opens up
way to simplify it even further in follow up PRs.
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.

2 participants