Skip to content

When building projects in watch mode, only schedule projects that need build or need update to bundle #48865

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 9 commits into from
May 23, 2022

Conversation

sheetalkamat
Copy link
Member

Earlier we use to build single project at 250ms and the next project build or project time stamp updates happened after another 250ms. Now only build and update bundle is scheduled with reduced time gap (100ms) and update timestamps happens right after project build
Fixes #48187

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Apr 27, 2022
@sheetalkamat
Copy link
Member Author

@andrewbranch can you please review.. would like to get this in early for 4.8

while (state.projectPendingBuild.size) {
// If already scheduled, skip
if (state.timerToBuildInvalidatedProject) return;
// Before scheduling check if the next project needs build
const info = getNextInvalidatedProjectCreateInfo(state, buildOrder, /*reportQueue*/ false);
if (!info) break; // Nothing to build any more
if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps) {
if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps && (changeDetected || projectsBuilt === 5)) {
Copy link
Member

Choose a reason for hiding this comment

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

How did you choose 5? What’s the advantage of having a delay between groups at all? (Is it so there are points where the operation can be canceled if a new change comes in?)

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 assumed that on an average the change to build 5 projects might be couple of seconds or less and that would be good time to check if there is new change...

Without adding delay, we wont be able to check if new change is detected and cancel existing chain of build

@sheetalkamat sheetalkamat merged commit 7c6521e into main May 23, 2022
@sheetalkamat sheetalkamat deleted the watchTimes branch May 23, 2022 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Build Performance] Additional Composite packages add fixed ~250ms watch build overhead
3 participants