Skip to content

refactor(@angular/build): pre-warm transformer worker pool and pass static options via workerData - #33839

Merged
dgp1130 merged 1 commit into
angular:mainfrom
clydin:perf-js-transformer-worker-init
Aug 11, 2026
Merged

refactor(@angular/build): pre-warm transformer worker pool and pass static options via workerData#33839
dgp1130 merged 1 commit into
angular:mainfrom
clydin:perf-js-transformer-worker-init

Conversation

@clydin

@clydin clydin commented Aug 11, 2026

Copy link
Copy Markdown
Member

Eagerly instantiate the worker pool in the JavaScriptTransformer constructor and set minThreads equal to maxThreads so worker threads are pre-warmed upfront during build context setup.

Pass global, static transformer options (sourcemap, thirdPartySourcemaps, advancedOptimizations, and jit) once during pool initialization via Piscina's workerData option instead of redundantly serializing them in per-file IPC task payloads.

…tatic options via workerData

Eagerly instantiate the worker pool in the JavaScriptTransformer constructor and set minThreads equal to maxThreads so worker threads are pre-warmed upfront during build context setup.

Pass global, static transformer options (sourcemap, thirdPartySourcemaps, advancedOptimizations, and jit) once during pool initialization via Piscina's workerData option instead of redundantly serializing them in per-file IPC task payloads.
@clydin clydin added the target: minor This PR is targeted for the next minor release label Aug 11, 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 refactors the JavaScript transformer worker to pass common options (such as sourcemap, thirdPartySourcemaps, advancedOptimizations, and jit) once via workerData during worker pool initialization instead of sending them with every transform request. Additionally, it replaces dynamic imports of OXC modules with static imports and configures minThreads on the worker pool. There are no review comments, and I have no feedback to provide.

@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 11, 2026
@clydin
clydin requested a review from alan-agius4 August 11, 2026 19:58
@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 Aug 11, 2026
@dgp1130
dgp1130 merged commit cabe95c into angular:main Aug 11, 2026
70 of 71 checks passed
@dgp1130

dgp1130 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

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

@clydin
clydin deleted the perf-js-transformer-worker-init branch August 11, 2026 22:53
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: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants