Commit 4182b96
committed
refactor(@angular/build): precompute expression indexes in i18n inliner worker
Previously, callSite.expressions.map((_, index) => index) was evaluated
on every $localize call site for every locale inside inlineLocalize.
In bundles with hundreds of call sites processed across multiple locales in
a batch, this resulted in thousands of redundant small array allocations.
expressionIndexes is now precomputed once during AST extraction in
extractLocalizeMetadata and stored on LocalizeCallSite, eliminating
per-locale index array allocations in the worker transformation loop.1 parent 0e632f1 commit 4182b96
1 file changed
Lines changed: 4 additions & 1 deletion
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
| |||
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
| 385 | + | |
384 | 386 | | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
| 392 | + | |
390 | 393 | | |
391 | 394 | | |
392 | 395 | | |
| |||
448 | 451 | | |
449 | 452 | | |
450 | 453 | | |
451 | | - | |
| 454 | + | |
452 | 455 | | |
453 | 456 | | |
454 | 457 | | |
| |||
0 commit comments