-
Notifications
You must be signed in to change notification settings - Fork 714
Release program after finishing program emit, Only cache dts and json source files #1623
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
Conversation
…mplement --w but in orchestrator)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements parity with Strada by releasing programs after emit and optimizing source file caching. It focuses on memory management and performance improvements for the TypeScript compiler port.
Key changes:
- Introduces program lifecycle management through
MakeReadonly()
to release programs after emit - Refactors program baselining to use a callback-based approach for better memory efficiency
- Optimizes source file caching to only cache
.d.ts
and.json
files that are expected to be reused
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
internal/execute/watcher.go |
Adds program callback to testing interface during watch cycles |
internal/execute/tsctests/sys.go |
Refactors program baselining from collection-based to callback-based approach |
internal/execute/tsctests/runner.go |
Updates test runner to use new baselining interface |
internal/execute/tsc/compile.go |
Removes IncrementalProgram array from command result, adds program callback interface |
internal/execute/tsc.go |
Adds program callback invocation for non-watcher compilation |
internal/execute/incremental/program.go |
Introduces MakeReadonly() method and refactors testing data structure |
internal/execute/incremental/emitfileshandler.go |
Updates to use new testing data structure |
internal/execute/incremental/affectedfileshandler.go |
Updates to use new testing data structure |
internal/execute/build/host.go |
Optimizes source file caching to only cache .d.ts and .json files |
internal/execute/build/buildtask.go |
Implements program release after emit using MakeReadonly() |
Comments suppressed due to low confidence (1)
internal/execute/incremental/program.go:312
- This function is now empty and appears to be unused. Consider removing it if it's no longer needed, or add a comment explaining why it's kept as a stub.
return
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
I'll be curious if in the future we can still cache input ts files, given people can use build mode to parse out the same set of files multiple times, e.g. for tests or for multi-emit-formats. But, from your wording, it sounds like you're saying that Strada did not do this? |
yeah - with project references - we will reference output file - which is d.ts file for the common projects so its very rare to have Esp imaging programs with 60k+ files, it quickly adds up |
… source files (microsoft#1623) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… source files (microsoft#1623) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Parity with Strada:
Release program after emit - (this releases program all together and snapshot for now but it will be retained for --w like in strada)
Cache only source files for d.ts and json files as those are the ones that are exepected to be reused
Fixes #1622