refactor(@angular/build): parallelize multi-locale inlining with 2D task sharding - #33911
Conversation
There was a problem hiding this comment.
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.
…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.
f9252a9 to
a70f3ff
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
The new
inlineFileBatchworker action processes multiple locales per file in memory while parsing sourcemaps and extracting AST metadata once per batch.I18nInlinernow providesinlineAllwith adaptive 2D task partitioning across files and locales to maximize worker thread utilization across any project topology. The application builder'sinlineI18nstep now dispatches all locales in parallel prior to executing per-locale post-bundle actions.