Skip to content

test(@angular/build): add performance benchmark suite for i18n inliner - #34100

Merged
alan-agius4 merged 2 commits into
angular:mainfrom
clydin:feat/i18n-inliner-benchmarks
Sep 17, 2026
Merged

alan-agius4 merged 2 commits into
angular:mainfrom
clydin:feat/i18n-inliner-benchmarks

Conversation

@clydin

@clydin clydin commented Sep 16, 2026

Copy link
Copy Markdown
Member

Introduces an automated macro performance benchmark suite for the i18n inlining subsystem in @angular/build, executable via the benchmark command.

The suite generates synthetic in-memory bundles, source maps, and translation catalogs to evaluate realistic workloads without checking large test fixtures into the repository.

Benchmark scenarios cover standard applications with and without source maps, enterprise multilingual applications across 32 locales, monolithic bundles to verify 2D task sharding, and warm persistent cache throughput.

Each scenario is executed in an isolated child process, and persistent cache priming is performed out-of-process to avoid cross-scenario memory contamination from the OS memory allocator. The harness collects high-precision timing, peak heap, peak RSS, and memory deltas with explicit garbage collection support.

Introduces an automated macro performance benchmark suite for the i18n inlining subsystem in @angular/build, executable via the benchmark command.

The suite generates synthetic in-memory bundles, source maps, and translation catalogs to evaluate realistic workloads without checking large test fixtures into the repository.

Benchmark scenarios cover standard applications with and without source maps, enterprise multilingual applications across 32 locales, monolithic bundles to verify 2D task sharding, and warm persistent cache throughput.

Each scenario is executed in an isolated child process, and persistent cache priming is performed out-of-process to avoid cross-scenario memory contamination from the OS memory allocator. The harness collects high-precision timing, peak heap, peak RSS, and memory deltas with explicit garbage collection support.

The runner is integrated into devkit-admin with support for baseline comparison, machine-readable JSON output, stale build detection, and automatic rebuilds.
@clydin clydin added the target: rc This PR is targeted for the next release-candidate label Sep 16, 2026
@clydin
clydin force-pushed the feat/i18n-inliner-benchmarks branch 2 times, most recently from 10bc395 to 928a359 Compare September 17, 2026 01:18
@clydin
clydin marked this pull request as ready for review September 17, 2026 01:18

@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 a performance benchmark runner for the Angular CLI's i18n inliner subsystem, adding several scripts and utilities to manage scenarios, generate synthetic bundles, execute tests, and report results. The review feedback highlights three important areas for improvement: first, a potential SyntaxError in scenarios.mts when spawning a child process with evaluated ES module code without the --input-type=module flag; second, a lack of validation for numeric CLI options (iterations, warmup, and concurrency) which could result in NaN or division-by-zero errors; and third, incomplete error handling in index.mts where proc.error is not checked when spawnSync fails.

Comment thread scripts/benchmarks/i18n/scenarios.mts
Comment thread scripts/benchmark.mts
Comment thread scripts/benchmarks/i18n/index.mts
Adds a large-scale stress test scenario to the i18n inliner benchmark suite with 10,000 translation messages across 32 locales. The scenario generates a 3 MB main bundle and 100 route chunks with source maps, evaluating binary translation catalog encoding, small file batching, and memory scaling under maximum enterprise workloads.
@clydin
clydin force-pushed the feat/i18n-inliner-benchmarks branch from 928a359 to ae6291b Compare September 17, 2026 01:35
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 17, 2026
@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 Sep 17, 2026
@alan-agius4
alan-agius4 merged commit d285bd8 into angular:main Sep 17, 2026
40 of 41 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

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

@clydin
clydin deleted the feat/i18n-inliner-benchmarks branch September 17, 2026 12:34
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: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants