Skip to content

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

Closed
alan-agius4 wants to merge 0 commit into
angular:mainfrom
alan-agius4:perf-counter
Closed

fix(@angular/build): aggregate parallel worker performance timings on the main thread#33425
alan-agius4 wants to merge 0 commit into
angular:mainfrom
alan-agius4:perf-counter

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.

@alan-agius4 alan-agius4 requested a review from clydin June 19, 2026 12:01
@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 requires: TGP This PR requires a passing TGP before merging is allowed and removed requires: TGP This PR requires a passing TGP before merging is allowed labels Jun 19, 2026
@alan-agius4 alan-agius4 marked this pull request as ready for review June 19, 2026 12:03

@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 performance timing aggregation across parallel compilation workers by adding helper functions to retrieve, clear, and merge cumulative durations, and updating the parallel compilation and worker diagnostics to pass and merge these timings. The feedback suggests simplifying the map-to-object conversion in profiling.ts using Object.fromEntries, extending timing aggregation to other compilation phases like initialize and emit, and adding unit tests to verify the serialization and merging of timings from the parallel worker.

Comment thread packages/angular/build/src/tools/esbuild/profiling.ts Outdated
Comment thread packages/angular/build/src/tools/angular/compilation/parallel-compilation.ts Outdated
Comment thread packages/angular/build/src/tools/angular/compilation/parallel-compilation.ts Outdated
@alan-agius4 alan-agius4 force-pushed the perf-counter branch 5 times, most recently from d740020 to 9f8bc46 Compare June 22, 2026 11:53
@angular-robot angular-robot Bot added the area: build & ci Related the build and CI infrastructure of the project label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build area: build & ci Related the build and CI infrastructure of the project target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant