Skip to content

perf(@angular/build): dispose builder result context early in non-watch mode#33436

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:perf-early-disposal
Jun 23, 2026
Merged

perf(@angular/build): dispose builder result context early in non-watch mode#33436
clydin merged 1 commit into
angular:mainfrom
clydin:perf-early-disposal

Conversation

@clydin

@clydin clydin commented Jun 23, 2026

Copy link
Copy Markdown
Member

Evaluates and extracts final output results into a list before calling result.dispose() in non-watch mode. This ensures all compiler worker processes (retaining the TypeScript program structures and cache) are terminated and reclaimed before yielding results to the caller for disk writing.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Jun 23, 2026
@angular-robot angular-robot Bot added area: performance Issues related to performance area: @angular/build labels Jun 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the build action to dispose of the build result when watch mode is disabled. The review feedback points out a potential double-disposal issue where result.dispose() could be called twice, and suggests setting watchLoopStarted = true to prevent this.

Comment thread packages/angular/build/src/builders/application/build-action.ts
…ch mode

Evaluates and extracts final output results into a list before calling result.dispose() in non-watch mode. This ensures all compiler worker processes (retaining the TypeScript program structures and cache) are terminated and reclaimed before yielding results to the caller for disk writing.
@clydin clydin force-pushed the perf-early-disposal branch from 7841041 to 15e442a Compare June 23, 2026 14:38
@clydin clydin requested a review from alan-agius4 June 23, 2026 14:58
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 23, 2026
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 23, 2026
@clydin clydin merged commit 3019c80 into angular:main Jun 23, 2026
41 checks passed
@clydin

clydin commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the perf-early-disposal branch June 23, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build area: performance Issues related to performance target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants