-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Optimize the size for tsbuildinfo #43155
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
|
@typescript-bot pack this |
|
@typescript-bot pack this |
|
Heya @sheetalkamat, I've started to run the tarball bundle task on this PR at 41026d7. You can monitor the build here. |
|
Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
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.
Looks good, I noticed a few minor nitpicks for the test runner
.../tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js
Outdated
Show resolved
Hide resolved
|
I tried this version in my project. Total Size: 14.9MB -> 1.0MB
|
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
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.
Can you please summarize the high-level changes? Pulling out numeric identifiers seems like an easy win - what else changed?
tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-composite.js
Outdated
Show resolved
Hide resolved
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.
My review was somewhat shallow, but the explanation made sense and I didn't notice obvious bugs.
This is simplified version of #43079 and additional optimizations for
tsbuildinfosizeChanges are:
fileNames: new entry which is list of filenamestsbuildinfowill encounter, index of the file name is used asfileIdeverywherefileInfos: is now a list instead of map.FileFnfois for the file at givenfileIdas indexaffectedFilesPendingEmitalso usefileIdinstead of file namefileIdsthatreferenceMaporexportedModulesMapwill use. Index of this list will be used asfileIdsListIdfor reference mapreferenceMapandexportedModulesMapis converted to tuple array with first entry beingfileIdand second one beingfileIdsListIdtsbuildinfowith 2 space indent, its emitted without spacestsbuildinfoas areadable.baseline.txtso that we can verify correctness easily