Skip to content

fix(@angular/build): aggregate parallel worker performance timings on the main thread#33429

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:perf-conter
Jun 23, 2026
Merged

fix(@angular/build): aggregate parallel worker performance timings on the main thread#33429
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:perf-conter

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Rather than having the parallel worker thread print its cumulative durations separately to the console (which causes console spam and disjointed/incomplete final logs), we serialize and return the worker's durations to the main thread upon completing the diagnostics task. The main thread then merges them into the global cumulative durations map, producing a single, complete, and perfectly aggregated performance report at the end of the build.

… the main thread

Rather than having the parallel worker thread print its cumulative durations separately to the console (which causes console spam and disjointed/incomplete final logs), we serialize and return the worker's durations to the main thread upon completing the diagnostics task. The main thread then merges them into the global cumulative durations map, producing a single, complete, and perfectly aggregated performance report at the end of the build.
@alan-agius4 alan-agius4 requested a review from clydin June 22, 2026 11:56
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jun 22, 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 introduces profiling duration tracking for parallel compilation by gathering cumulative durations from the worker thread during the diagnose task and merging them back on the main thread. Feedback suggests extending this tracking to include the initialize and emit tasks to prevent losing their profiling data, and refactoring mergeCumulativeDurations to accept undefined to simplify caller-side checks.

Comment thread packages/angular/build/src/tools/esbuild/profiling.ts
@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
@alan-agius4 alan-agius4 merged commit 851711b into angular:main Jun 23, 2026
78 checks passed
@alan-agius4 alan-agius4 deleted the perf-conter branch June 23, 2026 07:56
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

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

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 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