Commit b097be0
committed
perf(@angular/build): process batch locales sequentially in i18n inliner worker
Executing batch locales concurrently via Promise.all within a single
worker thread provided no concurrency benefit because inlining operations
(MagicString transformations and source map decoding/remapping) are
predominantly synchronous and CPU-bound on Node's single-threaded event loop.
Holding concurrent MagicString instances, intermediate AST slices, and
decoded source map mappings simultaneously inflated peak worker heap and RSS
(especially for smaller chunks where up to 8 locales are processed in a single
batch).
Switching to sequential iteration allows intermediate transformation and
mapping structures to be garbage-collected between locales, reducing peak RSS
and slightly improving throughput due to reduced GC pressure.1 parent 73f6bbb commit b097be0
1 file changed
Lines changed: 18 additions & 19 deletions
Lines changed: 18 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
290 | 290 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
299 | 298 | | |
300 | 299 | | |
301 | 300 | | |
| |||


0 commit comments