Skip to content

refactor(@angular/build): parallelize multi-locale inlining with 2D task sharding - #33911

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:perf/i18n-multi-locale-batching
Aug 24, 2026
Merged

refactor(@angular/build): parallelize multi-locale inlining with 2D task sharding#33911
clydin merged 1 commit into
angular:mainfrom
clydin:perf/i18n-multi-locale-batching

Conversation

@clydin

@clydin clydin commented Aug 24, 2026

Copy link
Copy Markdown
Member

The new inlineFileBatch worker action processes multiple locales per file in memory while parsing sourcemaps and extracting AST metadata once per batch. I18nInliner now provides inlineAll with adaptive 2D task partitioning across files and locales to maximize worker thread utilization across any project topology. The application builder's inlineI18n step now dispatches all locales in parallel prior to executing per-locale post-bundle actions.

@clydin clydin added the target: minor This PR is targeted for the next minor release label Aug 24, 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 parallel multi-locale inlining capabilities to the Angular build system's i18n inliner. It replaces sequential locale-by-locale processing with a parallelized inlineAll method and adds batch processing support (inlineFileBatch) in the worker thread, utilizing an adaptive 2D task-partitioning algorithm to optimize performance and caching. The review feedback highlights two opportunities to further improve performance by parallelizing asynchronous operations: first, by using Promise.all to process locales concurrently within the worker's batch processing loop, and second, by executing persistent cache writes concurrently rather than sequentially.

Comment thread packages/angular/build/src/tools/esbuild/i18n-inliner-worker.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/i18n-inliner.ts
…ask sharding

The new `inlineFileBatch` worker action processes multiple locales per file
in memory while parsing sourcemaps and extracting AST metadata once per batch.
`I18nInliner` now provides `inlineAll` with adaptive 2D task partitioning
across files and locales to maximize worker thread utilization across any
project topology. The application builder's `inlineI18n` step now dispatches
all locales in parallel prior to executing per-locale post-bundle actions.
@clydin
clydin force-pushed the perf/i18n-multi-locale-batching branch from f9252a9 to a70f3ff Compare August 24, 2026 16:32
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 24, 2026
@clydin
clydin requested a review from alan-agius4 August 24, 2026 16:50
@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 24, 2026
@clydin
clydin merged commit 6acadf2 into angular:main Aug 24, 2026
41 checks passed
@clydin

clydin commented Aug 24, 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/i18n-multi-locale-batching branch August 24, 2026 17:17
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.

2 participants