Skip to content

perf(@angular/build): use size-weighted task heuristics in i18n inliner - #33962

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:perf/i18n-size-weighted-heuristics
Open

perf(@angular/build): use size-weighted task heuristics in i18n inliner#33962
clydin wants to merge 1 commit into
angular:mainfrom
clydin:perf/i18n-size-weighted-heuristics

Conversation

@clydin

@clydin clydin commented Aug 28, 2026

Copy link
Copy Markdown
Member

Incorporate Longest Processing Time First (LPT) scheduling, hybrid relative sizing, and hardware-adaptive sliding windows for task dispatch in I18nInliner.

Previously, files were dispatched in arbitrary insertion order, partitioned using a uniform locale batch size across all files regardless of byte size, and processed in fixed 8-locale sliding windows. This could result in large dominant files like main.js starting late in a window and causing single-worker straggler latency at the window barrier, while small chunks were unnecessarily fragmented into multiple IPC tasks and high-core machines (>8 cores) were throttled by the fixed 8-locale limit.

@clydin clydin added the target: minor This PR is targeted for the next minor release label Aug 28, 2026
@angular-robot angular-robot Bot added area: performance Issues related to performance area: @angular/build labels Aug 28, 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 optimizes the i18n inlining process by sorting files by size (Longest Processing Time First) and dynamically adjusting batch sizes to maximize worker thread utilization and minimize IPC overhead. Feedback suggests optimizing the file sorting logic by pre-computing file sizes to avoid redundant map lookups inside the sort comparator.

Comment thread packages/angular/build/src/tools/esbuild/i18n-inliner.ts Outdated
Incorporate Longest Processing Time First (LPT) scheduling, hybrid relative
sizing, and hardware-adaptive sliding windows for task dispatch in I18nInliner.

Previously, files were dispatched in arbitrary insertion order, partitioned
using a uniform locale batch size across all files regardless of byte size, and
processed in fixed 8-locale sliding windows. This could result in large dominant
files like main.js starting late in a window and causing single-worker straggler
latency at the window barrier, while small chunks were unnecessarily fragmented
into multiple IPC tasks and high-core machines (>8 cores) were throttled by the
fixed 8-locale limit.
@clydin
clydin force-pushed the perf/i18n-size-weighted-heuristics branch from 3d08dcd to 2a8410a Compare August 28, 2026 15:29
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 28, 2026
@clydin
clydin requested a review from alan-agius4 August 28, 2026 17:59
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: performance Issues related to performance target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant