-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Build improvements #48784
Build improvements #48784
Conversation
…ile so we know buildInfo was written Also baseline these so its easy to verify the changes
… update the signature when doing actual emit
…, everything needs update in signature and dts emit Fixes #42769
… it more than fileExists wherever possible
…ts for experiment
@amcasey @andrewbranch i have highlighted important commits and the change in the description and also have left some comments during the change. Let me know if you need more details. |
@sheetalkamat That table's great! When you ran those scenarios, did you do any checks to determine whether the output was the same as before? Also, do you have a similar (or simpler) table for compiling TypeScript itself? |
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.
Your offline explanation made sense and I appreciate your thorough perf testing. I added some notes on naming and comments, but mostly I think we should check this in ASAP and see what happens.
I think this might have caused a regression. In my project, when I introduce errors and build with
I noticed this when doing the TS 4.8 upgrade. I observe this with version 4.8.2. I'm happy to open a new issue for this if that's preferable. I first noticed this after using |
New issue is definitively better, check if there is no similar issue. |
Commits: 16cef4a, 59ad6ef, c8327da
tsc --build
and other scenarios where we would do existence check as well asstat
which resulted in two stat calls, we just check modified timeCommits: cb7aca3
tsc --build
while determining upto date ness status, we now check if referenced projects have errors so that we dont need to go through input and output timestamps in that caseCommits: 89d2d4c
stat
on files and that time is now passed through as part of file watcher event sotsc --build
can use it.Commits: 6e0c916
Fixes Build mode explicitly checks file stamps in watch mode rather than using file watcher events #45082
Commits: 7cb0f40, 1a8abac, 59f2b5c, dc21283, 5bccee8,
tsbuildInfo
alone determines upto date ness of the build. For this we now storechangeFileSet
,dtsChangeTime
andemitSignatures
for the output files in the buildInfo when in multi file emit scenario.fileVersions
,outSignature
,dtsChangeTime
in single file output scenario.emitSignatures
andoutSignature
are the d.ts hash of the output that last changed to the disk. Since any composite project already has declaration as must we can store this easily and save having to read files on emit to see if the d.ts file has changed. This makes sure that whether you are intsc --build
ortsc --build --watch
mode the state is persisted so we know exactly if we need to really build or just update timestamps.Commits: 2f2e370, fcf07f8, 15fe24e
composite
also meansincremental
which is must for referenced proejcts)Commits: 6198fa3,
Commits: 62c687b
Commits: 4fb6773
Commits: 0f7903d, 437619e
BuilderState
,BuilderProgramState
etc structures so its correctly reflected.Commits: e6a3ee8
tsc --build --force
now doesnt query input file stamps (it never did query output file stamps)Commits: b32d2eb
Commits: 303824e
Commits: 28a9ff3
tsc --build
if file timestamp is changed but its text has not, we read the file and do pseudo update (only in incremental build).Commits: e4e6672 - Delete only tsbuildinfo instead of all output files when doing clean on incremental projectHere are the numbers from run on solution with large (1994) number of projects.
On Typescript Code base: